TL;DR
Fine-tuning Large Language Models (LLMs) on multiple tasks simultaneously often leads to an uneven balancing act where fast-learning tasks overfit before slower ones can catch up. This paper introduces CoBa (Convergence Balancer), a lightweight multi-task learning approach that dynamically adjusts task weights based on validation loss trends. CoBa ensures all tasks converge at an even pace without the massive computational overhead of traditional gradient-based methods, boosting downstream performance by up to 13%.
What Problem Does This Paper Address?
Multi-task learning (MTL) is a highly attractive, resource-efficient strategy for training a single LLM to handle various downstream tasks. However, different tasks naturally learn and converge at different speeds.
Standard MTL approaches usually fall into two traps:
- Naïve Data Mixing (Uniform): They mix task data equally, which ignores uneven convergence rates. This often causes simpler tasks to overfit and diverge while harder tasks are still underfitting.
- Gradient Manipulation (e.g., GradNorm, FAMO): They compute and balance task-specific gradients to harmonize learning. While effective for smaller models, these methods are prohibitively expensive for LLMs because calculating gradients across multiple tasks scales poorly with parameter size and task count.
The authors address a critical question: How can we achieve balanced task convergence during LLM fine-tuning without exploding the computational training costs?
Methods
CoBa (COnvergence BAlancer) bypasses expensive gradient calculations entirely by tracking the slopes of validation losses over a sliding history window.
As illustrated in Figure 1, CoBa dynamically computes task weights using three core components:
- Relative Convergence Score (RCS): This metric compares convergence speeds between tasks. Tasks that are converging rapidly (steep downward loss slopes) have their weights reduced to prevent early overfitting, while slower tasks get a boost.
- Absolute Convergence Score (ACS): This metric isolates a task's individual history. If a task begins to overfit and diverge (the loss slope turns positive), ACS slashes its weight to prevent it from harming the overall model performance.
- Divergence Factor (DF): A dynamic gating mechanism that transitions dominance from RCS to ACS. Early in training, when all tasks are converging smoothly, DF ensures RCS dictates the weights. As training progresses and certain tasks begin to overfit, DF shifts control to ACS.
By utilizing a simple closed-form linear regression to calculate these loss slopes, CoBa maintains a remarkably low time complexity of $\mathcal{O}(2F + B + a_3K)$ (where $F$ and $B$ are forward/backward passes and $K$ is the number of tasks), making it highly practical for LLM training.
Datasets
The authors evaluated CoBa across four diverse generative datasets:
- Code Completion (CC) Dataset: Covers 5 programming languages (Python, Java, C++, JavaScript, Go), evaluated via the Pass@1 metric on HumanEval and HumanEval-X.
- Code-Related Task (CRT) Dataset: Features 5 distinct tasks including code completion, code translation, Text2Code, unit testing, and code summarization.
- XTREME-UP: A multilingual benchmark focusing on question-answering across 9 languages, mixing high-resource (e.g., English, Arabic) and low-resource (e.g., Bengali, Telugu) languages.
- Multi-Domain QA Dataset: A highly diverse dataset spanning coding, mathematics, and natural language processing.
Key Insights and Ideas
- Validation Loss Over Training Loss: Traditional MTL methods balance training loss, but CoBa focuses entirely on validation loss. This shifts the optimization priority toward generalization rather than raw memorization.
- Gradients are Overkill for Balancing: You don't need to compute complex, high-dimensional task gradients to balance multi-task training. Tracking the scalar trajectory of validation losses provides a sufficient and vastly cheaper signal.
- The Divergence Trap: Simply slowing down fast tasks (via RCS) isn't enough. If a task starts to actively overfit, continuing to give it substantial weight can ruin the model's shared parameters. The introduction of ACS acts as an essential safety valve to suppress diverging tasks.
Key Results
- Performance Breakthroughs: CoBa consistently outperformed Single-Task Learning (STL), Uniform mixing, and advanced SOTA baselines. On the CC dataset with a Phi-1.5 base model, CoBa achieved a 4% relative improvement in average Pass@1 over the next best validation-adapted baseline ($\text{FAMO}^*$).
- Scaling Advantages: When scaled up to a larger CodeLlama-13B-Python base model, CoBa’s advantage widened, boasting a minimum 5% enhancement in average Pass@1 relative to other SOTA methods.
- Low-Resource Language Gains: On the XTREME-UP dataset, CoBa achieved a 3% to 5% absolute increase in span $F_1$ scores for low-resource languages like Bengali and Telugu compared to STL, demonstrating excellent positive knowledge transfer.
- High Efficiency: Runtime analysis confirmed that CoBa is significantly faster per epoch than other validation-set-based balancing methods (like $\text{GradNorm}^*$ and $\text{FAMO}^*$), performing closely to the baseline Uniform approach.
Limitations and Future Work
- Model Parameter Scale: Due to hardware resource constraints, the authors only evaluated models up to 13B parameters. Testing CoBa's efficacy on 70B+ parameter models remains an open area for future validation.
- Task Conflicts: While CoBa balances convergence speeds, it does not resolve fundamental negative interference when tasks directly conflict. The authors suggest integrating CoBa with Mixture-of-Experts (MoE) frameworks to isolate conflicting task parameters into specific expert layers.
- Clash with Curriculum Learning: CoBa naturally prioritizes harder tasks early on, which is the exact opposite of curriculum learning (which prioritizes easy tasks first). Exploring how to modify CoBa to dynamically alternate between these philosophies across different training stages is a promising future direction.
Summary updated