One Model, Many Skills: Parameter-Efficient Fine-Tuning for Multitask Code Analysis

Amal Akli, Maxime Cordy, Mike Papadakis, Yves Le Traon · DOI

TL;DR

This paper presents the first systematic study of combining Multi-Task Learning (MTL) with Parameter-Efficient Fine-Tuning (PEFT) for code analysis. The authors demonstrate that a single, tiny set of shared weights can handle multiple diverse tasks—like bug detection and code search—matching the performance of full fine-tuning while slashing computational costs by up to 85% and outperforming zero-shot prompting of models 30x their size.

What Problem Does This Paper Address?

While Large Language Models (LLMs) like GPT-4 excel at generating code, their performance on analyzing code (e.g., identifying security vulnerabilities or detecting duplicate logic) is less consistent. To specialize a model for these tasks, researchers typically use fine-tuning.

However, two major hurdles exist:

  1. Resource Intensity: Fully fine-tuning billions of parameters for every individual task is computationally and financially ruinous.
  2. Task Fragmentation: Maintaining separate model weights for every specific analysis task (Defect Detection, Clone Detection, etc.) creates a massive storage and deployment headache.

Multi-task learning (MTL) aims to solve this by training one model on many tasks, but "full" MTL is still expensive. This paper investigates whether we can use PEFT—techniques that update less than 1% of a model's weights—to achieve "one model, many skills" efficiency in the domain of software engineering.

Methods

The researchers evaluated four prominent PEFT strategies:

  • Serial Adapters: Small bottleneck layers inserted sequentially within Transformer blocks.
  • Parallel Adapters: Similar to serial, but running in parallel with existing layers.
  • LoRA (Low-Rank Adaptation): Injecting trainable low-rank matrices into the attention layers.
  • Prefix Tuning: Adding learnable vectors to the input of each layer.

The "MFT" (Multi-task Fine-Tuning) Pipeline: The authors used a "hard parameter sharing" approach. They froze a backbone model (like DeepSeek-Coder) and added shared PEFT modules. To handle different task outputs, they used simple, task-specific "heads" (MLPs).

A key technical contribution is their Dynamic Loss Weighting. Instead of manually balancing the importance of different tasks, they implemented a learnable softmax-based weighting system. This allows the model to automatically prioritize tasks during training based on their difficulty and learning progress, mitigating "negative transfer" (where learning one task hurts performance on another).

Datasets

The study utilized four diverse benchmarks from the CodeXGLUE ecosystem and beyond:

  • Devign: Defect detection (binary classification of C functions).
  • BigCloneBench: Clone detection (identifying if two Java methods are semantically identical).
  • AdvTest: Code search (retrieving code snippets based on natural language queries).
  • FlakeFlagger: Test flakiness prediction (identifying non-deterministic Java tests).

Key Insights and Ideas

  • Specialization Trumps Scale: One of the most striking "aha" moments is that a 1B-parameter model fine-tuned with multi-task PEFT significantly outperformed 34B-parameter models (like CodeLlama-34B) using zero-shot prompting. For deep code analysis, "general" intelligence isn't a substitute for targeted tuning.
  • Task "Friendships" (Complementarity): Not all tasks play well together. The authors found that Clone Detection and Code Search are highly complementary because both rely on understanding semantic similarity. Pairing them often boosted performance beyond what either could achieve alone.
  • The Asymmetry of Learning: Some relationships are one-way. For example, Vulnerability Detection benefited from being paired with Flakiness prediction (likely acting as a regularizer), but Flakiness prediction didn't get any better by looking at vulnerabilities.
  • Architecture Sensitivity: Encoder-decoder models (like CodeT5+) and decoder-only models (like Qwen) reacted differently to PEFT. Decoder-only models generally saw more consistent gains from adapter-based methods.

Key Results

  • Performance Parity: Multi-task PEFT (MFT) delivered accuracy within 1-3% of single-task fine-tuning (SFT), and in some cases, actually surpassed it.
  • Massive Efficiency: MFT reduced the number of trainable parameters by a factor equal to the number of tasks (4x in this study).
  • Compute Savings: For the Qwen model, using Serial Adapters in a multi-task setup was 7.1x cheaper (85.9% fewer tokens processed) than running four separate single-task tuning sessions.
  • LoRA for Retrieval: LoRA emerged as the superior choice for retrieval-heavy tasks (Code Search), while Adapters were more reliable for classification tasks.

Limitations and Future Work

The authors acknowledge several constraints:

  • Model Scale: Due to hardware limits (46GB GPU RAM), they could only perform full fine-tuning comparisons on models up to ~2B parameters.
  • Task Scope: The study focused on classification and retrieval (analysis) rather than generative tasks like code synthesis or summarization.
  • Task Grouping: While they identified which tasks pair well, they suggest that future work should investigate automated, principled ways to group heterogeneous objectives to prevent task interference.

By proving that PEFT and MTL are a "match made in heaven" for code analysis, this paper provides a blueprint for deploying highly capable, specialized software engineering tools on modest hardware.

Summary updated

Abstract

Large language models have recently surpassed specialized systems on code generation, yet their effectiveness on other code-analysis tasks remains less clear. At the same time, multi-task learning offers a way to unify diverse objectives within a single model, but fully fine-tuning LLMs across tasks is computationally prohibitive. Parameter-efficient fine-tuning mitigates this cost by updating only a small fraction of weights. Although PEFT has proven effective in single-task settings, its potential for multi-task learning has not yet been systematically explored. We present the first comprehensive evaluation of multi-task PEFT for code analysis, comparing several methods across diverse tasks and model architectures. Our experiments show that a single PEFT module shared across tasks can match, and in some cases surpass, full multi-task fine-tuning, confirming that the benefits of PEFT extend beyond isolated tasks. When comparing single-task and multi-task setups, we find that multi-task PEFT achieves a favorable performance-efficiency trade-off: it delivers accuracy close to single-task fine-tuning while reducing storage requirements, cutting the number of trainable parameters by a factor of the task count, and lowering computation costs by as much as 85%. At the same time, multi-task gains remain sensitive to task grouping. Through task-pairing experiments, we identify key factors shaping outcomes: task stability, model architecture, task complementarity, asymmetry, and dataset quality determine the success of co-fine-tuning. Finally, we benchmark efficient multi-task PEFT against direct prompting of open-source general-purpose LLMs, including DeepSeek, Qwen, Mistral, CodeLlama, and StarCoder. Despite their strong performance in code generation, these models underperform on analysis tasks, where even a 1B-parameter model with multi-task PEFT achieves significantly better results.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Test-flakiness predictionQwen2.5-Coder-1.5B, Serial adapter (multi-task)F172.54%+4.23 vs baselinesplit: test · multi-task · params=1.5B · adapter=serial · setting=four-task · backbone=Qwen2.5-Coder-1.5B
Source quote
L286: Serial adapter │ 0.71 │ 92.68 │ \DOWN{0.18} │ \multicolumn{1}{c}{60.87 } │ \UP{0.11} │ 72.54 │ \UP{4.23} │ 29.80 │ \DOWN{1.26}
Reported baseline / comparator measurements (1)
BenchmarkMethodMetricScoreProtocol / Evidence
Test-flakiness predictionQwen2.5-Coder-1.5B, Full fine-tuning (multi-task) baselineF168.31%split: test · multi-task · method=full fine-tuning · params=1.5B · setting=four-task · backbone=Qwen2.5-Coder-1.5B
Source quote
L285: Full │ 100.00 │ 92.86 │ \multicolumn{1}{c}{60.76} │ 68.31 │ 31.06
BibTeX
@misc{akli2026one,
  author = {Amal Akli and Maxime Cordy and Mike Papadakis and Yves Le Traon},
  title = {{One Model, Many Skills: Parameter-Efficient Fine-Tuning for Multitask Code Analysis}},
  year = {2026},
  eprint = {2603.09978},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.09978},
}
Figure