Natural Language Fine-Tuning

Jia Liu, Yue Wang, Zhiqi Lin, Min Chen, Yixue Hao, Long HuarXiv 2024

TL;DR

Natural Language Fine-Tuning (NLFT) is a novel, lightweight fine-tuning method that uses natural language as a token-level supervisory signal rather than relying on heavy reinforcement learning or data-hungry supervised methods. By analyzing how a model's internal token probabilities shift when given standard answers or critiques, NLFT achieves massive accuracy gains on domain-specific tasks using as few as 50 data points, all while maintaining the low computational complexity of standard Supervised Fine-Tuning (SFT).

What Problem Does This Paper Address?

Fine-tuning Large Language Models (LLMs) for specialized, domain-specific tasks usually requires a mountain of high-quality labeled data. When data is scarce, standard Supervised Fine-Tuning (SFT) quickly falls prey to severe overfitting.

To squeeze more performance out of limited data, researchers recently turned to Reinforced Fine-Tuning (ReFT), which uses Reinforcement Learning (RL) algorithms like PPO to optimize model parameters. However, RL introduces massive time and space complexities, requires unstable multi-round SFT "warm-ups," and frequently collapses into non-learning states if the dataset is too small.

The authors introduce NLFT to bridge this gap, providing a highly efficient, stable, and low-resource alternative for sample-strapped fine-tuning.

Methods

Instead of converting natural language feedback into a single, coarse scalar reward (like traditional RLHF), NLFT directly leverages the target LLM's language comprehension capabilities at the token level.

The training process varies depending on whether the model's Chain-of-Thought (CoT) output is correct or incorrect:

  1. Prompt Generation: For a given question, the algorithm generates different input prompts: a base question ($X_{base}$), a question paired with the standard answer ($X_{standard}$), and a question paired with an external natural language critique/judgment ($X_{judge}$).
  2. Saliency Token Allocation: The model evaluates the conditional probability of generating each token under these different prompt conditions.
  3. For correct outputs, tokens that see a significant probability spike when given the standard answer ($X_{standard}$) are flagged as saliency tokens (key scoring points).
  4. For incorrect outputs, tokens that shift drastically when exposed to a natural language critique ($X_{judge}$) are flagged as losing tokens.
  5. Loss Function Scaling: Rather than treating all tokens equally, NLFT scales the loss function based on these token classifications. Saliency tokens receive higher weights, while irrelevant tokens are minimized or zeroed out.
Figure 2: Training process of SFT, ReFT, and NLFT. (a) The training process of SFT, which can be analogous to a student directly learning from a collection of exercises, which include problems and their reference solutions; (b) The training process of ReFT, which can be realized as a student repeatedly submitting their exam answers to a grading system, receiving scores, and striving to discover the strategies that maximize their marks; (c) The training process of our proposed algorithm NLFT, which is similar to a student submitting exam answers and receiving detailed feedback from a natural language evaluator. The system highlights the scoring points and losing points, allowing the student to learn from both well-graded examples (i.e., for learning from teaching) and their work (i.e., for self-study), thereby increasing their performance.

Crucially, because NLFT operates purely through forward inference passes to calculate these probability shifts, its algorithmic complexity remains $O(n)$—identical to SFT—and completely bypasses the need for an RL critic network or an SFT warm-up phase.

Figure 3: An example of the training process of NLFT, which takes question, standard answer, and judgment as inputs and generates dif- ferent Input Prompts. Then, under different prompts, the algorithm compares different conditional probabilities to allocate the saliency token and assign scale values.

Datasets

The authors evaluated NLFT using the GSM8K dataset, a standard benchmark for grade-school math word problems that requires multi-step reasoning. To test the low-data regime, they sampled minimal training subsets ranging from just 50 to 800 instances, comparing performance against full-dataset baselines (7,473 training samples).

Key Insights and Ideas

  • LLMs as High-Fidelity Supervisors: The core "aha moment" is that an LLM’s internal probability distribution shifts predictably when context changes. By comparing $P(token | question)$ vs $P(token | question + answer)$, the model inherently reveals which tokens represent the critical logical leaps.
  • Overfitting Mitigation via Saliency: SFT overfits on small datasets because it forces the model to memorize entire sequences blindly. NLFT acts as a regularizer by telling the model exactly which tokens matter, allowing it to generalize math reasoning pathways from tiny sample sizes.
  • RL-Level Gains without RL Overhead: NLFT achieves the optimization benefits typically sought from PPO-based reinforcement learning simply by restructuring the token-level cross-entropy loss using linguistic context.

Key Results

  • Massive Gains with Minimal Data: With a training set of just 50 samples, NLFT achieved an accuracy of 64.29% on GSM8K, outperforming SFT's accuracy gain over the base model by 219%.
Figure 1: Accuracy Comparison of SFT and NLFT on GSM8K dataset. NLFT has the same time and space complexity as SFT but achieves a 27% increase in fine-tuning performance, maintaining a stable performance advantage thereafter. With minimal dataset sam- ples (only 50 data points), a brief training period (3 epochs, 287 seconds), and low computational resource consumption (44.46 GB of GPU memory usage), NLFT does not require a warm-up phase and can achieve a performance 1.19 times greater than SFT. Accord- ing to the ReFT paper, ReFT is unable to outperform SFT within 8 epochs.
  • Drastic Resource Savings: Compared to ReFT, NLFT reduced time complexity by 78.27% and space (GPU memory) complexity by 92.24%. While ReFT required an average of 599.57 GB of total memory across an 8-GPU setup, NLFT ran comfortably on a lightweight 2-GPU setup utilizing only 46.87 GB.
  • Long-term Stability: As training epochs increased, SFT's performance sharply declined due to overfitting, and ReFT collapsed to zero accuracy due to small-sample instability. NLFT maintained a stable, high accuracy of ~70-73% throughout.

Limitations and Future Work

The primary limitation acknowledged by the authors is learning efficiency from incorrect samples. While NLFT successfully identifies "losing tokens" using natural language critiques, the overall performance boost gained from processing incorrect answers remains significantly lower than learning from correct ones.

Future work will focus on optimizing how the model digests negative feedback and expanding NLFT to other complex, structured domains such as code generation, medical diagnosis, and natural language inference.

Summary updated

BibTeX
@misc{liu2024natural,
  author = {Jia Liu and Yue Wang and Zhiqi Lin and Min Chen and Yixue Hao and Long Hu},
  title = {{Natural Language Fine-Tuning}},
  year = {2024},
  eprint = {2412.20382},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.20382},
}
Figure