[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EN0KYP217SZ4E4P10EFASF":3,"skill-same:01M7EN0KYP217SZ4E4P10EFASF":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EN0KYP217SZ4E4P10EFASF","few-shot-learning",null,"Teach models new tasks from a handful of examples — prompting strategies, example selection, and in-context learning mechanics.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-few-shot-learning\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: few-shot-learning\ndescription: Teach models new tasks from a handful of examples — prompting strategies, example selection, and in-context learning mechanics.\ncategory: ai-research\n---\n\n## Overview\n\nFew-shot learning with large language models means teaching a task through examples\nplaced in the prompt — no weight updates. Show the model 2–10 input-output pairs\ndemonstrating the pattern, then give it a new input. The model infers the task\nfrom the demonstrations: the output format, the label space, the reasoning style.\nIt's the fastest way to prototype a new capability, and for many tasks it matches\nor beats fine-tuning, especially when labeled data is scarce.\n\nWhat makes it work is still partly mysterious, but the practical levers are well\nmapped: example selection (which demonstrations), example ordering (sequence\neffects are real), formatting (consistent delimiters the model can latch onto),\nand the number of shots (more isn't always better — context gets diluted). Modern\npractice treats the few-shot prompt as a small program to be engineered and\nevaluated, not as prose to be admired.\n\nThe strategic role of few-shot prompting has shifted: it's now the prototyping\nlayer. Prove the task works few-shot, then decide whether to keep the prompt, move\nto fine-tuning, or distill into a smaller model.\n\n## When to use\n\n- Prototyping a new classification, extraction, or transformation task before\n  committing to fine-tuning.\n- Tasks with scarce labeled data where fine-tuning would overfit.\n- One-off or rapidly-changing tasks where retraining is impractical.\n- Steering output format precisely (JSON schemas, specific label sets, stylistic\n  constraints).\n- Evaluating whether a task is learnable at all — if few-shot fails badly, the\n  task definition is probably the problem.\n- Low-volume tasks where prompt-engineering cost beats fine-tuning cost.\n\n## Core concepts\n\n- **In-context learning**: the model's ability to infer a task from demonstrations\n  without gradient updates. Emerges with scale; larger models need fewer, less\n  carefully chosen examples.\n- **Example selection**: the highest-leverage variable. Strategies: random\n  (surprisingly strong baseline), semantic retrieval (pick training examples most\n  similar to the query via embeddings), diversity sampling (cover the label space\n  and edge cases), and difficulty-based (include hard examples the model gets wrong\n  zero-shot).\n- **Ordering effects**: models are recency-biased — examples near the end of the\n  prompt influence the output more. Also susceptible to majority-label bias\n  (predicting the most frequent label in the demonstrations). Shuffle and test\n  multiple orders.\n- **Format consistency**: use identical delimiters and structure across examples\n  (`Input: ... Output: ...`). The model learns the template as much as the task;\n  inconsistency in the template is inconsistency in the lesson.\n- **Shot count trade-offs**: accuracy usually rises steeply to 4–8 shots then\n  plateaus or degrades as the context fills with near-duplicates. Test the curve\n  rather than assuming more is better.\n- **Calibration**: few-shot predictions inherit the label bias of the\n  demonstrations. If your examples are 80% class A, expect inflated class-A\n  predictions. Balance the demonstration set or calibrate outputs.\n- **Retrieval-augmented selection**: for production, retrieve per-query examples\n  from a pool using embeddings. Usually beats a fixed example set, at the cost of\n  a retrieval step.\n- **Demonstration quality**: one wrong example teaches the wrong pattern\n  confidently. Verify every demonstration's correctness — the model trusts them\n  absolutely.\n\n## Practical workflow\n\n1. **Write the zero-shot baseline first.** A clear task instruction with no\n   examples. Measure it — this tells you how much the examples are actually\n   adding.\n2. **Curate 8–15 candidate examples.** Cover every label\u002Fclass, include 1–2 tricky\n   edge cases, keep each example short. Quality and coverage beat quantity.\n3. **Verify every example.** Each demonstration must be correct and representative.\n   A single wrong example poisons the pattern the model infers.\n4. **Build the prompt template.** Fixed instruction + examples in a rigid format +\n   the query in the same format. Delimit examples clearly.\n5. **Select per query (for harder tasks).** Retrieve the k most similar examples\n   to each query from your candidate pool using embeddings. This usually beats a\n   fixed example set.\n6. **Evaluate systematically.** Test on a held-out set: vary shot count (0, 2, 4,\n   8), example orders, and selection strategies. Report variance across orders —\n   if results swing wildly, the prompt is fragile.\n7. **Decide: prompt or fine-tune.** If few-shot with retrieved examples hits your\n   accuracy bar reliably, ship the prompt. If it's fragile, slow (long contexts\n   cost latency and money), or the task is stable and high-volume, distill the\n   examples into a fine-tune.\n\nChecklist for a production few-shot prompt:\n- Evaluated on held-out data with multiple example orders; variance acceptable.\n- Label distribution in demonstrations balanced or deliberately chosen.\n- Every demonstration verified correct.\n- Failure cases reviewed: model fails on genuinely hard inputs, not format\n  confusion.\n- Latency and cost of the long prompt acceptable at expected volume.\n- Fallback defined for when retrieval finds no good examples.\n\n## Common pitfalls\n\n- **Testing on the training examples.** Evaluating few-shot accuracy on the same\n  examples shown in the prompt measures memorization of the prompt, not learning.\n  Always held-out.\n- **Ignoring order variance.** A prompt that scores 90% with one order and 70%\n  with another is not a 90% prompt. Report the distribution.\n- **Kitchen-sink prompts.** Twenty rambling examples with inconsistent formatting\n  teach the model that the task is \"produce rambling text.\" Fewer, cleaner\n  examples win.\n- **Label bias blindness.** Demonstrations skewed toward one class silently become\n  a prior. Balance or calibrate.\n- **Assuming more shots = better.** Beyond the plateau, extra examples add\n  latency, cost, and sometimes confusion. Find the knee of the curve.\n- **Fragile formatting.** If changing \"Output:\" to \"Answer:\" breaks the task, you\n  don't have a robust solution — you have a lucky incantation. Harden the template\n  or fine-tune.\n- **Unverified demonstrations.** Including an example you haven't checked. The\n  model treats demonstrations as ground truth — so must you.\n- **No per-query retrieval.** Using a fixed example set when queries vary widely.\n  Retrieved examples usually win; the retrieval step is cheap compared to the\n  accuracy gain.\n","## Overview\n\nFew-shot learning with large language models means teaching a task through examples\nplaced in the prompt — no weight updates. Show the model 2–10 input-output pairs\ndemonstrating the pattern, then give it a new input. The model infers the task\nfrom the demonstrations: the output format, the label space, the reasoning style.\nIt's the fastest way to prototype a new capability, and for many tasks it matches\nor beats fine-tuning, especially when labeled data is scarce.\n\nWhat makes it work is still partly mysterious, but the practical levers are well\nmapped: example selection (which demonstrations), example ordering (sequence\neffects are real), formatting (consistent delimiters the model can latch onto),\nand the number of shots (more isn't always better — context gets diluted). Modern\npractice treats the few-shot prompt as a small program to be engineered and\nevaluated, not as prose to be admired.\n\nThe strategic role of few-shot prompting has shifted: it's now the prototyping\nlayer. Prove the task works few-shot, then decide whether to keep the prompt, move\nto fine-tuning, or distill into a smaller model.\n\n## When to use\n\n- Prototyping a new classification, extraction, or transformation task before\n  committing to fine-tuning.\n- Tasks with scarce labeled data where fine-tuning would overfit.\n- One-off or rapidly-changing tasks where retraining is impractical.\n- Steering output format precisely (JSON schemas, specific label sets, stylistic\n  constraints).\n- Evaluating whether a task is learnable at all — if few-shot fails badly, the\n  task definition is probably the problem.\n- Low-volume tasks where prompt-engineering cost beats fine-tuning cost.\n\n## Core concepts\n\n- **In-context learning**: the model's ability to infer a task from demonstrations\n  without gradient updates. Emerges with scale; larger models need fewer, less\n  carefully chosen examples.\n- **Example selection**: the highest-leverage variable. Strategies: random\n  (surprisingly strong baseline), semantic retrieval (pick training examples most\n  similar to the query via embeddings), diversity sampling (cover the label space\n  and edge cases), and difficulty-based (include hard examples the model gets wrong\n  zero-shot).\n- **Ordering effects**: models are recency-biased — examples near the end of the\n  prompt influence the output more. Also susceptible to majority-label bias\n  (predicting the most frequent label in the demonstrations). Shuffle and test\n  multiple orders.\n- **Format consistency**: use identical delimiters and structure across examples\n  (`Input: ... Output: ...`). The model learns the template as much as the task;\n  inconsistency in the template is inconsistency in the lesson.\n- **Shot count trade-offs**: accuracy usually rises steeply to 4–8 shots then\n  plateaus or degrades as the context fills with near-duplicates. Test the curve\n  rather than assuming more is better.\n- **Calibration**: few-shot predictions inherit the label bias of the\n  demonstrations. If your examples are 80% class A, expect inflated class-A\n  predictions. Balance the demonstration set or calibrate outputs.\n- **Retrieval-augmented selection**: for production, retrieve per-query examples\n  from a pool using embeddings. Usually beats a fixed example set, at the cost of\n  a retrieval step.\n- **Demonstration quality**: one wrong example teaches the wrong pattern\n  confidently. Verify every demonstration's correctness — the model trusts them\n  absolutely.\n\n## Practical workflow\n\n1. **Write the zero-shot baseline first.** A clear task instruction with no\n   examples. Measure it — this tells you how much the examples are actually\n   adding.\n2. **Curate 8–15 candidate examples.** Cover every label\u002Fclass, include 1–2 tricky\n   edge cases, keep each example short. Quality and coverage beat quantity.\n3. **Verify every example.** Each demonstration must be correct and representative.\n   A single wrong example poisons the pattern the model infers.\n4. **Build the prompt template.** Fixed instruction + examples in a rigid format +\n   the query in the same format. Delimit examples clearly.\n5. **Select per query (for harder tasks).** Retrieve the k most similar examples\n   to each query from your candidate pool using embeddings. This usually beats a\n   fixed example set.\n6. **Evaluate systematically.** Test on a held-out set: vary shot count (0, 2, 4,\n   8), example orders, and selection strategies. Report variance across orders —\n   if results swing wildly, the prompt is fragile.\n7. **Decide: prompt or fine-tune.** If few-shot with retrieved examples hits your\n   accuracy bar reliably, ship the prompt. If it's fragile, slow (long contexts\n   cost latency and money), or the task is stable and high-volume, distill the\n   examples into a fine-tune.\n\nChecklist for a production few-shot prompt:\n- Evaluated on held-out data with multiple example orders; variance acceptable.\n- Label distribution in demonstrations balanced or deliberately chosen.\n- Every demonstration verified correct.\n- Failure cases reviewed: model fails on genuinely hard inputs, not format\n  confusion.\n- Latency and cost of the long prompt acceptable at expected volume.\n- Fallback defined for when retrieval finds no good examples.\n\n## Common pitfalls\n\n- **Testing on the training examples.** Evaluating few-shot accuracy on the same\n  examples shown in the prompt measures memorization of the prompt, not learning.\n  Always held-out.\n- **Ignoring order variance.** A prompt that scores 90% with one order and 70%\n  with another is not a 90% prompt. Report the distribution.\n- **Kitchen-sink prompts.** Twenty rambling examples with inconsistent formatting\n  teach the model that the task is \"produce rambling text.\" Fewer, cleaner\n  examples win.\n- **Label bias blindness.** Demonstrations skewed toward one class silently become\n  a prior. Balance or calibrate.\n- **Assuming more shots = better.** Beyond the plateau, extra examples add\n  latency, cost, and sometimes confusion. Find the knee of the curve.\n- **Fragile formatting.** If changing \"Output:\" to \"Answer:\" breaks the task, you\n  don't have a robust solution — you have a lucky incantation. Harden the template\n  or fine-tune.\n- **Unverified demonstrations.** Including an example you haven't checked. The\n  model treats demonstrations as ground truth — so must you.\n- **No per-query retrieval.** Using a fixed example set when queries vary widely.\n  Retrieved examples usually win; the retrieval step is cheap compared to the\n  accuracy gain.\n",{"name":5,"category":24,"description":7},"ai-research","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-few-shot-learning",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill few-shot-learning",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill few-shot-learning",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill few-shot-learning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-few-shot-learning\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]