Abstract
CoDa is a training-free data augmentation framework that leverages off-the-shelf Large Language Models (LLMs) to generate synthetic training data for low-resource NLP tasks. By extracting simple heuristic constraints from existing data and feeding them to the LLM as natural language prompts, CoDa produces highly diverse yet task-consistent examples, boosting downstream performance without the need for complex fine-tuning or decoding algorithms.
Introduction
In Natural Language Processing (NLP), training robust models requires massive amounts of data, which is often unavailable for specialized domains like legal or biomedical text. While researchers have increasingly turned to generative AI to synthesize training data, controlling autoregressive LLMs remains notoriously difficult.
If an LLM generates data that is too diverse, it risks drifting away from the underlying distribution of the target task, which can hurt downstream performance. Conversely, traditional augmentation methods like text-editing (e.g., synonym replacement) often fail to introduce meaningful diversity. Existing controlled generation methods usually require complex, computationally heavy decoding-time interventions. CoDa addresses this gap by asking: How can we explicitly control LLM-based data augmentation using simple, automated natural language instructions?
Methodology: The CoDa Pipeline
The authors propose CoDa (Constrained Generation based Data Augmentation), a pipeline that uses instruction-tuned LLMs (like LLaMa-2) in a completely training-free manner. Given a small, low-resource dataset, CoDa processes each document by extracting five types of heuristic constraints:
- Lexical: Extracts top n-grams using SentenceBERT embeddings to ensure key vocabulary is retained.
- Syntactic: Extracts Part-of-Speech (POS) sequences to maintain the formal tone and structure of specific domains.
- Semantic (Label): Provides the target label along with three random exemplars from the dataset to ensure label consistency.
- Length: Restricts the generated token count based on the standard deviation of the dataset's length distribution.
- Concept (Spurious Features): Identifies spurious phrases (shortcuts the model might exploit) and asks the LLM to extract their abstract concepts. These are then added as negation constraints (e.g., "Do not include the concept of 'market volatility'").
These constraints are verbalized into a single natural language prompt. The LLM is then instructed to either generate a completely novel document or rephrase a retrieved, semantically similar document from the dataset.
Experimental Setup
The authors evaluated CoDa across 11 datasets spanning 3 distinct NLP tasks, specifically simulating low-resource settings by restricting training data to 100, 200, or 500 samples:
- Sequence Classification (SC): HuffPost (news), Yahoo (Q&A), OTS (legal terms of service), ATIS (travel intent), and MASSIVE (multilingual intent).
- Named Entity Recognition (NER): CoNLL-2003 (news), OntoNotes-5.0 (diverse), EBMNLP (biomedical), and BC2GM (biomedical).
- Question Answering (QA): SQuAD (Wikipedia) and NewsQA (CNN articles).
Key Results and Insights
CoDa consistently outperformed a wide array of baselines, including EDA, SSMBA, GENIUS, and GPT3Mix. It improved downstream F1 scores by 0.12% to 5.94% in Sequence Classification, 0.47% to 7.19% in NER, and 1.10% to 3.06% in QA.
Key Insights
- Natural Language is Enough for Control: The paper demonstrates that you don't need intricate decoding algorithms to control generation. Simple, well-structured natural language constraints are sufficient to guide off-the-shelf LLMs.
- Negating Spurious Features: One of the most clever additions is the "Concept Constraint." Data augmentation often accidentally amplifies spurious correlations present in small datasets. By explicitly telling the LLM what concepts to avoid, CoDa actively prevents the amplification of these shortcuts.
- Domain Agnosticism: Because CoDa extracts constraints directly from the source text, it adapts seamlessly to highly formalized domains (like legal or biomedical text) where other augmentation methods typically struggle to maintain the correct syntactic structure.
Conclusion
CoDa provides a robust, training-free method for data augmentation in low-resource settings. While it incurs higher computational costs due to LLM inference, its ability to generate high-quality, diverse, and task-consistent data makes it a powerful tool for specialized NLP domains. Future work will explore compositional prompting to break down complex constraints into simpler, sequential instructions.
Summary updated