Context-aware Prompt Tuning: Advancing In-Context Learning with Adversarial Methods
Not on the map. Why?
Abstract (arXiv)
Fine-tuning Large Language Models (LLMs) typically involves updating at least a few billions of parameters. A more parameter-efficient approach is Prompt Tuning (PT), which updates only a few learnable tokens, and differently, In-Context Learning (ICL) adapts the model to a new task by simply including examples in the input without any training. When applying optimization-based methods, such as fine-tuning and PT for few-shot learning, the model is specifically adapted to the small set of training examples, whereas ICL leaves the model unchanged. This distinction makes traditional learning methods more prone to overfitting; in contrast, ICL is less sensitive to the few-shot scenario. While ICL is not prone to overfitting, it does not fully extract the information that exists in the training examples. This work introduces Context-aware Prompt Tuning (CPT), a method inspired by ICL, PT, and adversarial attacks. We build on the ICL strategy of concatenating examples before the input, but we extend this by PT-like learning, refining the context embedding through iterative optimization to extract deeper insights from the training examples. We carefully modify specific context tokens, considering the unique structure of input and output formats. Inspired by adversarial attacks, we adjust the input based on the labels present in the context, focusing on minimizing, rather than maximizing, the loss. Moreover, we apply a projected gradient descent algorithm to keep token embeddings close to their original values, under the assumption that the user-provided data is inherently valuable. Our method has been shown to achieve superior accuracy across multiple classification tasks using various LLM models.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 39 of its 48 references that are in the map. First posted on arXiv 22 Oct 2024.
Builds on
39 of 48 references.
References · 39
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2014Explaining and Harnessing Adversarial Examplescited by 7,364
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,415
- 2019Parameter-Efficient Transfer Learning for NLPcited by 4,236
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,330
27 more
- 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,984
- 2022Large Language Models Encode Clinical Knowledgecited by 1,830
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2021BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-modelscited by 1,245
- 2016Adversarial Machine Learning at Scalecited by 936
- 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 896
- 2014Deep Neural Networks are Easily Fooled: High Confidence Predictions for Unrecognizable Imagescited by 776
- 2017Evasion Attacks against Machine Learning at Test Timecited by 689
- 2017Adversarial Examples Are Not Easily Detected: Bypassing Ten Detection Methodscited by 546
- 2021Compacter: Efficient Low-Rank Hypercomplex Adapter Layerscited by 460
- 2019How to Fine-Tune BERT for Text Classification?cited by 411
- 2022RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learningcited by 366
- 2021True Few-Shot Learning with Language Modelscited by 344
- 2020Uncovering the Limits of Adversarial Training against Norm-Bounded Adversarial Examplescited by 278
- 2021PTR: Prompt Tuning with Rules for Text Classificationcited by 238
- 2021PPT: Pre-trained Prompt Tuning for Few-shot Learningcited by 232
- 2021Fixing Data Augmentation to Improve Adversarial Robustnesscited by 204
- 2022Delta Tuning: A Comprehensive Study of Parameter Efficient Methods for Pre-trained Language Modelscited by 180
- 2023Multitask Prompt Tuning Enables Parameter-Efficient Transfer Learningcited by 115
- 2024Mind Your Format: Towards Consistent Evaluation of In-Context Learning Improvementscited by 83
- 2024LoRA-Pro: Are Low-Rank Adapters Properly Optimized?cited by 77
- 2021Prompt Waywardness: The Curious Case of Discretized Interpretation of Continuous Promptscited by 64
- 2023When does In-context Learning Fall Short and Why? A Study on Specification-Heavy Taskscited by 37
- 2022Threat Model-Agnostic Adversarial Defense using Diffusion Modelscited by 24
- 2023How Does In-Context Learning Help Prompt Tuning?cited by 11
- 2023Class-Conditioned Transformation for Enhanced Robust Image Classificationcited by 5
- 2024IntCoOp: Interpretability-Aware Vision-Language Prompt Tuningcited by 5
Built on by
Citing papers per year: 2025: 4.
4 papers.
- 2025Problem Solved? Information Extraction Design Space for Layout-Rich Documents using LLMscited by 6
- 2025Helping Large Language Models Protect Themselves: An Enhanced Filtering and Summarization Systemcited by 2
- 2025Alchemist: Towards the Design of Efficient Online Continual Learning Systemcited by 0
- 2025Modeling Code: Is Text All You Need?cited by 0
- 2025Modeling Code: Is Text All You Need?15 Jul 2025
- 2025Helping Large Language Models Protect Themselves: An Enhanced Filtering and Summarization System2 May 2025
- 2025Alchemist: Towards the Design of Efficient Online Continual Learning System3 Mar 2025
- 2025Problem Solved? Information Extraction Design Space for Layout-Rich Documents using LLMs25 Feb 2025