| name | q-tuning-joint-pruning-efficient-training |
| title | Winning the Pruning Gamble: A Unified Approach to Joint Sample and Token Pruning for Efficient Supervised Fine-Tuning |
| version | 0.0.2 |
| engine | skillxiv-v0.0.2-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2509.23873 |
| keywords | ["data-pruning","token-pruning","training-efficiency","data-selection","fine-tuning"] |
| description | Dramatically reduce training data requirements (to 12.5% of original) while improving model performance using joint sample and token pruning guided by Error-Uncertainty plane diagnostics. Asymmetric pruning preserves calibration signals while removing redundant tokens from misconception examples. |
Q-Tuning: Joint Sample and Token Pruning via Error-Uncertainty Analysis
Training LLMs on massive datasets is expensive, but much of that data is redundant. The challenge is identifying which examples and which tokens matter. Prior work handles either sample-level pruning (which examples to keep?) or token-level pruning (which tokens to truncate?), but not both jointly. This mismatch means either discarding valuable signals or wasting compute on irrelevant tokens.
Q-Tuning introduces the Error-Uncertainty (EU) plane: a diagnostic tool that simultaneously characterizes data quality at sample and token levels. Using this, you can apply asymmetric pruning—aggressive token removal for misconception examples (where tokens don't matter much) while preserving calibration samples entirely (where every token matters).
Core Concept
The Error-Uncertainty plane is a 2D diagnostic that plots each training sample by two metrics:
- Error: Does the model get this example right or wrong?
- Uncertainty: How confident is the model on this example?
This creates four quadrants:
- High Error, High Uncertainty: Misconceptions (model confidently wrong). Prune aggressively.
- High Error, Low Uncertainty: Calibration signals (model knows it's uncertain). Keep entirely.
- Low Error, High Uncertainty: Confusing examples (not representative). Prune moderately.
- Low Error, Low Uncertainty: Easy examples (redundant). Prune moderately.
For each quadrant, apply different token-pruning ratios: keep informative misconceptions as calibration signals, but prune their less-important tokens.
Architecture Overview
- Error detector: Binary classification (correct/incorrect) on each example
- Uncertainty quantifier: Compute confidence scores (probability, variance, entropy)
- EU plane mapper: Plot samples, categorize by quadrant
- Token scorer: Rank token importance within each sample
- Asymmetric pruner: Apply quadrant-specific pruning ratios
- Training loop: Standard fine-tuning with pruned data
Implementation Steps
First, compute error and uncertainty scores for all training data:
import torch
import numpy as np
from collections defaultdict
:
():
.model = model
.tokenizer = tokenizer
():
scores = []
batch_idx (, (dataset), batch_size):
batch = dataset[batch_idx : batch_idx + batch_size]
inputs = .tokenizer(
[ex[] ex batch],
padding=,
return_tensors=
)
torch.no_grad():
outputs = .model(**inputs)
logits = outputs.logits
i, example (batch):
predicted_token_id = logits[i, -, :].argmax()
target_token = .tokenizer.encode(example[])[]
is_correct = predicted_token_id == target_token
probs = torch.softmax(logits[i, -, :], dim=-)
entropy = -(probs * torch.log(probs + )).().item()
max_entropy = np.log(logits.shape[-])
normalized_entropy = entropy / max_entropy
scores.append({
: batch_idx + i,
: is_correct ,
: normalized_entropy
})
scores