← Back to Concept Contrast

Concept Contrast Fable

In-context learning and few-shot prompting: one relies on the model to induce patterns itself, the other relies on you providing examples

Conclusion first:The two terms are often used interchangeably, but in system design they point to different things. In-context learning is the model's ability to infer patterns on its own from information in the current conversation window; few-shot prompting is when you actively insert a few examples into the input to guide the output format or style. Only after distinguishing them do you know what to optimize.

The two terms are often used interchangeably, but in system design they point to different things. In-context learning is the model's ability to infer patterns on its own from information in the current conversation window; few-shot prompting is when you actively insert a few examples into the input to guide the output format or style. Only after distinguishing them do you know what to optimize.

Fable

The apprentice and the recipe in the kitchen

On the old street there was a private restaurant where the head chef trained apprentices in a very unusual way. He did not have them memorize recipes, but only stand by the stove and watch. Watch the master handle ingredients of different seasons, adjust seasoning according to heat, and improvise cuts when guest requests changed. After three years, the apprentices naturally learned the rhythm and judgment of cooking, and could handle ingredients they had never seen before.

A chain store opened next door, and its training method was to hand out cards. Each card contained the complete steps for three similar dishes, and the new chef followed the pattern on the card to make the fourth dish. When the card changed, the dish made changed accordingly. The chef did not need to understand the principles, only to copy the structure on the card.

Once the restaurant association held a competition, requiring both shops to each create an innovative dish specified by the judges. The private kitchen's apprentice looked at the ingredient list, recalled the master's techniques for similar ingredients and the kitchen conversations that day, and made a dish that carried the master's shadow but was not exactly the same. The chain restaurant's chef searched the entire card box, but no card matched the requirements of this new dish, and what he made was stiff and awkward.

Only then did everyone start asking what exactly the difference was between the two training methods. The apprentice had not permanently swapped brains; he simply adjusted his technique on the fly based on the ingredients on the stove that day, what the master had just said, and the previous dishes. The card chef relied on fixed similar cases organized by others, with one set of cards handling one type of dish.

Later, someone came up with a clumsy idea: write the master's cooking process on hundreds of cards and stuff them into the chain restaurant cooks' hands. The more cards there were, the more confused the cooks became—they originally needed only one similar template, but now faced with a mountain of ingredient notes, they did not know which card to look at.

When the two shops later collaborated, they set a rule: for new dishes and new ingredients, let the apprentice try first, and let the method naturally emerge from the kitchen environment; once proven feasible, then select the most critical few cards for chain-store chefs to reference. The apprentice is responsible for growing things out of the environment; the cards are responsible for passing what has grown to more people.

Looking back years later, the most valuable thing was that division of labor: some people are responsible for generating capability in information-rich environments, and some are responsible for packaging capability into transferable examples. The number of cards doesn't matter; the boundary of the division matters. Each stage does its own job, and neither should pretend it can replace the other.

In-context learning

During inference, the model uses contextual information in the conversation window to induce patterns on its own, without updating parameters. It is a capability attribute of the model.

Few-shot prompting

Actively provide several examples in the prompt to guide the model to output following the example pattern. It is a prompt design strategy.

Story Mapping

  • The apprentice stands by the stove and watches for three years: in-context learning, where the model absorbs and summarizes on its own within the conversation window
  • Three similar dish steps on a card: few-shot prompting, actively inserting examples to guide output format
  • The apprentice can also handle new ingredients: ICL capability generalization when facing unseen tasks
  • The more cards, the more confused the chef: too many prompt examples actually interfere with the model's judgment

Applying it to an Agent project

When designing Agent behavior, first determine: do you need the model to understand context changes on its own from the conversation history (relying on ICL), or do you need to give a few fixed examples to lock the output format (relying on few-shot)? The former depends on the model's capability ceiling, while the latter depends on example quality. Do not equate few-shot accuracy directly with strong ICL ability in evaluations.

京ICP备2026014272号