Source-linked AI summary

Semantic Anchors in In-Context Learning: Why Small LLMs Cannot Flip Their Labels

Anantha Padmanaban Krishna Kumar

arXiv:2511.21038v1cs.CLcs.AIcs.LG

TL;DR

The paper asks whether few-shot ICL can override pre-trained label semantics or mainly refine existing behavior, especially in smaller open-source models. It compares natural and inverted demonstrations using alignment measures and finds no coherent semantic override in its 1–12B setting.

  • Problem

    Whether ICL learns new input-label mappings or refines pre-trained behavior remains contested, including whether 1–12B open-source models can learn anti-semantic mappings in few-shot settings.

    Source: §1 · pp. 1–2
  • Method

    The study compares natural and inverted demonstrations, measures truth, prior, and prompt alignment, and defines semantic override as correctness under the inverted mapping.

    Source: §1 · p. 2, §3.3 · p. 3
  • Results

    Across eight tasks and eight models, inverted demonstrations yield exactly zero semantic override, while natural ICL raises average accuracy from 69.5% to 79.3% at k = 8.

    Source: §5.1 · p. 4, §6 · p. 7
  • Takeaways & Limitations

    ICL primarily adjusts how inputs project onto pre-existing semantic directions and does not redefine label-token meanings.

    Source: §6 · p. 7

    The findings cover few-shot prompting in 1–12B models and leave open whether the constraint extends from semantically loaded labels to arbitrary symbol-concept mappings.

    Source: §6 · p. 7

Abstract

from arXiv · show

Can in-context learning (ICL) override pre-trained label semantics, or does it merely refine an existing semantic backbone? We address this question by treating LLMs as prompt-induced classifiers and contrasting their behavior under \emph{natural} demonstrations (with correct labels) and \emph{inverted} demonstrations (systematically flipping label meanings). We decompose ICL behavior into three alignment metrics (truth, prior, and prompt alignment) and introduce a semantic override rate, defined as correctness under flipped semantics. Across eight classification tasks and eight open-source LLMs (1--12B parameters), we find consistent evidence for a semantic anchor view. With natural demonstrations, ICL improves accuracy while maintaining strong prior alignment; most correct predictions coincide with zero-shot behavior, even when the prior is weak. With inverted demonstrations, models cannot learn coherent anti-semantic classifiers: prompt alignment increases only by sacrificing accuracy, and semantic override rates remain exactly zero in our few-shot 1--12B setting. Rather than flexibly remapping label meanings, ICL primarily adjusts how inputs project onto stable semantic directions learned during pre-training, clarifying fundamental limits of few-shot prompting and suggesting that overriding label semantics at these scales requires interventions beyond ICL. All code is available at: https://github.com/AnanthaPadmanaban-KrishnaKumar/semantic-anchors-icl.

1 Introduction

The paper asks whether in-context learning (ICL) learns new input-label mappings or refines pre-trained behavior. It tests whether few-shot prompting can override semantic label anchors in smaller open-source models.

1 Introduction

  • ICL is contested as either flexible task learning or refinement of existing classifiers.Task-learning accounts include Bayesian inference and gradient-descent simulation; prior-refinement evidence includes robustness to label permutations and bootstrapping from zero-shot predictions.Source: §1 · p. 1
  • Label tokens carry semantic commitments: changing positive to great can shift accuracy by tens of points, and models favor common tokens.Prior work found that overriding such anchors can require massive scale: GPT-3 can eventually flip labels, whereas smaller models cannot.Source: §1 · pp. 1–2
  • Across eight tasks and eight open-source models, natural ICL improves accuracy while retaining prior alignment, but inverted ICL yields exactly zero semantic override.The study covers models from 1–12B parameters across the LLaMA, Mistral, Qwen, and Gemma families.Source: §1 · p. 2
  • The paper interprets ICL as adjusting input projections onto a pre-trained semantic space without redefining label meanings.Source: §1 · p. 2

2 Related Work

Prior work examines ICL through label manipulation, mechanistic theories, and semantic label priors. Together, these strands motivate testing whether small open-source models can coherently override label semantics.

Semantic manipulation in ICL

  • Prior flipped-label studies found scale-dependent semantic override, while many-shot prompting also struggles at smaller scales.The paper extends this inquiry to 1–12B models using alignment metrics to distinguish failure modes beyond accuracy alone.Source: §2 · p. 2

Theoretical frameworks

  • Bayesian and meta-optimization accounts often treat labels as arbitrary symbols, but prior evidence indicates lasting pre-trained label relationships.Findings of Bayesian inconsistency and persistent label relationships support prior-constrained learning over flexible remapping.Source: §2 · p. 2

Label semantics as constraints

  • Label semantics and token biases can constrain ICL, while symbol tuning and contrastive decoding are described as ways to bypass those constraints.Prior work reports accuracy shifts from changing semantically loaded labels and probability competition between equivalent forms.Source: §2 · p. 2

3 Problem Setup

The paper formalizes ICL as a choice between a zero-shot prior and a demonstration-induced classifier, then evaluates how their predictions align with truth, prior behavior, and demonstrated mappings.

3 Problem Setup

  • ICL is formalized as a choice between a zero-shot prior and an in-context classifier induced by demonstrations.Source: §3 · p. 2

3.1 Zero-shot and In-Context Classifiers

  • The zero-shot prior uses task instructions, while the in-context classifier conditions on a demonstration set; metrics use inputs with non-UNK predictions.Predictions are obtained by greedy decoding.Source: §3.1 · p. 3

3.2 Natural vs. Inverted Demonstrations

  • Natural demonstrations use correct labels, whereas inverted demonstrations permute them; sentiment swaps POS and NEG, and NLI cycles its three labels.Source: §3.2 · p. 3

3.3 Alignment Metrics

  • Three alignments measure accuracy, agreement with zero-shot predictions, and agreement with demonstrated mappings; the semantic override rate requires both correctness and inverted-mapping agreement.Prompt alignment equals accuracy under natural demonstrations, but the metrics diverge under inverted demonstrations.Source: §3.3 · p. 3

4 Experimental Setup

The experiments span classification datasets and prompting conditions, with shared sampling and decoding settings used to compare models and conditions.

4.1 Models

4.2 Tasks and Datasets

  • The eight tasks cover sentiment, natural language inference, paraphrase detection, hate speech detection, and topic classification.Datasets include SST-2, IMDB, SNLI, MNLI, MRPC, QQP, ETHOS, and AG News.Source: §4.2 · p. 4

4.3 Prompting Conditions

  • Table 2 illustrates sentiment prompts: natural k-shot uses correct labels, while inverted k-shot flips them; other tasks follow the same pattern.For each test example, demonstrations are sampled from the same dataset using fixed random seeds for consistent comparisons.Source: Table 2 · p. 4, §4.3 · p. 4

4.4 Implementation Details

  • Predictions use greedy decoding for up to three generated tokens, with UNK outputs excluded from metrics and identical demonstration sets across models.The setup tests k ∈ {1, 2, 4, 8}, caps prompt lengths at 512 zero-shot and 2,048 few-shot tokens, and uses five sampling seeds.Source: §4.4 · p. 4

5 Results

Across eight classification tasks, LLaMA-3.1-8B-Instruct improves with natural demonstrations but loses accuracy under inverted demonstrations. Alignment results show prior refinement under natural ICL and no coherent semantic override under inversion, with the contrast growing as demonstrations increase.

5.1 Natural ICL improves accuracy, inverted ICL degrades it

  • Average accuracy rises from 69.5% (zero-shot) to 79.3% at k = 8 with natural ICL, but drops to 52.8% under inverted ICL.Inverted ICL still reaches 71.6% on QQP, above its weak zero-shot baseline but 7 points below natural ICL; weak priors can provide task-relevant signal without overriding semantic anchors.Source: §5.1 · pp. 4–5

5.2 ICL operates through prior refinement, not replacement

  • At k = 8, SST-2 reaches 92.5% accuracy with 89.8% zero-shot alignment, while natural ICL raises accuracy and joint correctness and leaves raw prior alignment stable.On QQP, accuracy rises by 37 points even as the model agrees with its zero-shot prior on 34.9% of examples.Source: Figure 1 · p. 5, §5.2 · pp. 5–6

5.4 Effects strengthen with demonstration count

  • As k rises from 1 to 8, natural ICL improves or holds across tasks, while inverted ICL sentiment losses grow from 5–10 points to over 40.Natural gains are larger with weak priors such as QQP than with strong priors such as SST-2.Source: Figure 2 · p. 5, §5.4 · p. 6

5.3 The semantic override paradox

  • On IMDB and SST-2, 51.6% and 52.6% of predictions match inverted labels, yet the semantic override rate remains exactly zero.Under inversion, prompt-following rises as accuracy and prior alignment decay, but joint alignment stays at zero.Source: §5.3 · p. 6

6 Conclusion

Across eight tasks and eight 1–12B models, inverted demonstrations do not induce coherent anti-semantic classifiers. The findings support prior refinement rather than flexible label remapping and point to interventions beyond prompt engineering for non-standard label meanings.

6 Conclusion

  • Across eight tasks and eight 1–12B models, the semantic override rate remains exactly zero under inverted demonstrations.Models cannot be both accurate and follow the inverted mapping; increasing prompt-following sacrifices accuracy.Source: §6 · p. 7
  • Natural demonstrations refine zero-shot behavior: most correct outputs coincide with the prior, while inputs project onto pre-existing semantic directions rather than redefining label meanings.The paper characterizes semantic anchors such as POS, NEG, and ENTAILMENT as rigid constraints on few-shot prompting.Source: §6 · p. 7
  • For tasks requiring non-standard label semantics, the authors recommend interventions such as symbol tuning, contrastive decoding, or fine-tuning rather than prompt engineering.Natural label semantics, by contrast, can benefit from ICL because demonstrations refine rather than fight the prior.Source: §6 · p. 7
  • Whether the proposed semantic constraint extends to arbitrary symbol-concept mappings, and how model scale affects it, remain questions for future work.The paper presents stable semantic regions in the representation manifold as a suggested geometric interpretation.Source: §6 · p. 7

A Complete Experimental Results

The reported results show a zero semantic override rate across experimental conditions, with complete task results presented in Tables 5–12.

A.1 Key Observations

Across models and tasks, inverted demonstrations yielded no semantic overrides, while accuracy declined with more demonstrations; the QQP and scale observations qualify this pattern.

A.1 Key Observations

  • The semantic override rate remained 0.0% across 320 conditions, and inverted-demonstration accuracy declined monotonically as k increased from 1 to 8.Source: §A.1 · p. 12
  • Sentiment tasks showed the strongest degradation, often losing more than 40 points at k = 8.Source: §A.1 · p. 12
  • Despite weak zero-shot QQP performance across models, models still did not override label semantics on that task.Source: §A.1 · p. 12
  • The no-override pattern held across the 1B–12B parameter range, with no evidence that larger models in that range overcame semantic anchors.Source: §A.1 · p. 12

B.2 Complete Prompt Templates

  • Table 13 provides the prompt templates and states that instructions are identical for natural and inverted conditions.Source: Table 13 · p. 13

B.3 Demonstration Example

  • Table 14 gives a k = 2 example of natural versus inverted sentiment demonstrations.Source: Table 14 · p. 13

B.1 Implementation Parameters

The experiments used fixed decoding, sequence-length, padding, and sampling settings, with five random seeds for each run.

  • Predictions used greedy decoding at temperature = 0, with a maximum of three new tokens.Source: §B.1 · p. 12
  • Zero-shot inputs were truncated to 512 tokens and k-shot inputs to 2,048 tokens, using left-sided padding and truncation.Source: §B.1 · p. 12
  • Experiments used five seeds, and demonstrations were sampled without replacement from training data while excluding the query example.Source: §B.1 · p. 12
Loading 2511.21038v1…