atlas

Research map / Architectures and efficiency / Pruning and efficient tuning

Where does In-context Learning Happen in Large Language Models?

NeurIPS 2024 · Architectures and efficiency › Pruning and efficient tuning · approach: Parameter-efficient transfer analysis · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Uses layer-wise context masking on GPT-Neo, BLOOM, StarCoder2 and Llama-3.1 models to locate a "task recognition" layer after which attention to the prompt context is redundant, and links this to LoRA layer adaptability.

Problem

Where inside causal LLMs the model transitions from recognizing the in-context task to performing it, with respect to instructions and demonstration examples.

Approach

Mask attention to instructions, examples, or query from a given layer onward and measure task performance per layer to find a task-recognition point after which context attention is unnecessary; exploit this for inference savings and for choosing layers for lightweight LoRA fine-tuning.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Mask attention to instructions and examples after the task-recognition layer (ablation)LLM in-context translation · FLORES en↔frtranslation performanceNo clear effect
Increase the number of prompt examples (ablation)GPTNEO2.7B and BLOOM3B · FLORES en→frtask-recognition layerNo clear effect
Provide instructions while masking examples (ablation)GPTNEO2.7B and BLOOM3B · FLORES en→frtranslation performance at earlier layersHelped
Mask the query rather than only task context (ablation)LLAMA models · FLORES translationtranslation performanceHurt
Use instruction-tuned rather than base LLAMA3.1-8B (ablation)LLAMA3.1 · FLORES en→fr, instructions present and examples maskedtranslation performance in earlier layersHelped
Use 400 rather than 800 training examples for lightweight LoRA tuning (ablation)LLAMA3.1-8B and LLAMA3.1-8B-INSTRUCT · FLORES en→frsuccessful fine-tuning of task locationHurt
Train LoRA on earlier-to-middle layers rather than later layers (ablation)LLAMA3.1-8B and LLAMA3.1-8B-INSTRUCT · FLORES en↔frtranslation performanceHelped
Train attention head gates with L0 regularisation instead of unregularised gates (ablation)GPTNEO2.7B and BLOOM3B · FLORES en→fr and en→ptBLEU: 18.3; 21.4; 20.1; 24.3; 24.5; 24.1; 6.7; 15.7; 8.6; 25.9; 19.6; 25.8Mixed
Use 0-prompt rather than 5-prompt training for L0(λ=.01) gates (ablation)GPTNEO2.7B and BLOOM3B · FLORES en→fr and en→ptBLEU: 18.9; 19.3; 13.2; 6.4; 23.6; 24.2; 26.0Mixed

Surprising findings

Limitations

Experimental setup

Datasets: FLORES HumanEval MBPP WMT06 Europarl

Benchmarks: FLORES HumanEval

Metrics: BLEU Pass@1

Baselines: no-masking full-context performance layer-dropping (Sajjad et al.)

Builds on: LoRA in-context learning as task recognition L0 regularisation for attention heads

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy