Entropy-Based Uncertainty Analysis for Multi-Agent LLM Systems
This skill enables Claude to apply the Entropy Judger framework from Zhao et al. (2026) to diagnose, evaluate, and improve multi-agent LLM systems. The core technique uses token-level, trajectory-level, and round-level entropy measurements to predict whether a multi-agent configuration will outperform a single agent, select the best solution from multiple runs (pass@k), and identify failure modes early in agent interactions. A critical finding: a single agent outperforms multi-agent systems in ~43% of cases, and first-round entropy dynamics are the strongest predictor of final correctness.
When to Use
- When the user is building a multi-agent system and wants to know whether multiple agents will actually help versus a single agent
- When the user has multiple candidate outputs from agent runs and needs to select the best one without ground truth
- When debugging why a multi-agent pipeline (debate, sequential, centralized) produces worse answers than expected
- When designing agent topologies (sequential, centralized, decentralized, debate, hybrid) and choosing which fits a task
- When the user wants to add an entropy-based quality gate to filter or rank LLM outputs before returning them
- When evaluating whether to add more agents or communication rounds to an existing system
Key Technique
The Entropy Judger reframes multi-agent solution selection as a supervised classification problem: given entropy traces from an agent run, predict whether the output is correct. For each candidate solution in a pass@k set, extract a feature vector of entropy statistics across tokens, reasoning trajectories, and communication rounds. An ensemble of XGBoost and LightGBM classifiers scores each candidate f(x) in [0,1], and the candidate with the highest predicted correctness probability is selected: best = argmax over k candidates of f(x_k).
The method rests on three empirically validated observations. Certainty Preference: reducing entropy at any stage for any agent correlates with correct solutions -- high peak entropy is universally harmful. Base Uncertainty: the foundation model's intrinsic entropy during problem-solving directly bounds multi-agent performance -- if the base model is highly uncertain (entropy > 100 nats across the sequence), adding agents rarely helps. Task Awareness: entropy dynamics play different roles across task types -- math tasks show strong entropy-correctness correlation (rho up to -0.92), while code generation tasks show weaker but still useful signal.
The practical implication is that first-round entropy dominates prediction. Round-1 maximum agent entropy is consistently among the top predictive features. Extended deliberation (5+ rounds) rarely overcomes poor initial uncertainty. This means you can make go/no-go decisions about an agent run very early.
Step-by-Step Workflow
Define the agent topology. Choose from: single agent, sequential (planner -> solver -> critic -> judger), centralized (domain agents + coordinator), decentralized (agents with feedback loops), full-decentralized (complete graph), debate (multi-agent voting), or hybrid (two-layer with context propagation). Default to single agent unless the task demonstrably benefits from decomposition.
Instrument entropy collection. For each LLM call in the pipeline, capture the raw logits or log-probabilities for every generated token. Compute per-token entropy as H(t) = -sum(p(v) * log(p(v))) over the vocabulary dimension. Store these as arrays alongside the generated text.
Compute trajectory-level features. For each agent's response, aggregate token entropies into: total_entropy, mean_entropy, max_entropy, min_entropy, median_entropy, std_entropy, q1/q3 entropy, coefficient of variation, IQR, skewness, and tail weight. This yields ~13 core features per agent response.
Compute round-level transition features. Across communication rounds, track: first-to-last round entropy difference, entropy slope (linear trend), volatility (std of per-round means), and per-round agent spread (max - min entropy across agents in a round). Focus especially on round-1 metrics -- they carry the most predictive signal.
Extract base-model reference entropy. Run the same prompt through a single agent with the same base model. Compute its entropy features as a baseline. Calculate deltas and ratios: delta_mean = mas_mean_entropy - base_mean_entropy, ratio_total = mas_total_entropy / base_total_entropy. These ~17 features capture whether the multi-agent setup is increasing or decreasing uncertainty relative to the base model.
Build the feature vector. Concatenate sample-level (13), shape (7), round-agent (100+), cross-round dynamics (20), answer-token (12), agent-level (10), base-model comparison (17), and computational metrics (15 for time/tokens) into a single vector per candidate solution. The full set is 245 features.
Train or apply the Entropy Judger classifier. If you have labeled data (correct/incorrect for past runs), train an XGBoost + LightGBM ensemble on the feature vectors. Use 5-fold cross-validation. If no labeled data is available, use a heuristic: select the candidate with the lowest mean entropy and lowest round-1 max entropy -- the Certainty Preference principle.
Select from pass@k candidates. Run the multi-agent system k times on the same input. Score each candidate with the trained classifier (or heuristic). Return the candidate with highest predicted correctness: best = argmax_k f(x_k).
Apply early-exit logic. After round 1, check if max agent entropy exceeds your task-specific threshold (e.g., >100 nats for math tasks). If so, consider falling back to a single-agent solution rather than continuing multi-round deliberation, which is unlikely to recover.
Iterate on topology. If the Entropy Judger consistently scores single-agent runs higher than multi-agent runs for your task, simplify the topology. Multi-agent systems add value primarily when base model uncertainty is moderate and the task benefits from decomposition (e.g., complex multi-step reasoning).
Concrete Examples
Example 1: Selecting the best answer from multiple agent debate runs
User: I'm running a 3-agent debate system on math problems and generating
5 candidate answers per problem. How do I pick the best one?
Approach:
1. For each of the 5 runs, collect per-token entropy from every agent
at every debate round.
2. Compute per-run feature vectors:
- mean_entropy across all agents and rounds
- max_entropy in round 1 (strongest single predictor)
- entropy_slope across rounds (is uncertainty decreasing?)
- std_entropy across agents in final round (consensus measure)
3. Rank candidates by: lowest round-1 max entropy first, then by
most negative entropy slope (uncertainty decreased most).
4. Return the top-ranked candidate.
Output (selection logic in Python):
```python
import numpy as np
def select_best_candidate(candidates):
"""Select best from pass@k using entropy heuristic.
Each candidate is a dict with:
- 'answer': str
- 'round_entropies': list of list of float
(rounds x agents, each entry is mean token entropy)
"""
scores = []
for c in candidates:
r1_max = max(c['round_entropies'][0]) # round-1 max agent entropy
all_means = [np.mean(r) for r in c['round_entropies']]
slope = all_means[-1] - all_means[0] # negative = uncertainty decreased
final_std = np.std(c['round_entropies'][-1]) # agent consensus
# Lower is better for all three components
score = r1_max + 0.5 * slope + 0.3 * final_std
scores.append(score)
return candidates[np.argmin(scores)]['answer']
Example 2: Deciding whether to use multi-agent or single-agent
User: I have a code generation task. Should I use a multi-agent system
or just a single agent?
Approach:
1. Run 20 sample problems through a single agent, collecting entropy.
2. Compute the base model's average mean_entropy across samples.
3. If mean_entropy > 80 nats: the base model is highly uncertain.
Multi-agent is unlikely to help (Base Uncertainty principle).
Invest in a better base model or better prompting first.
4. If mean_entropy is moderate (30-80): multi-agent may help.
Try a sequential (planner -> coder -> reviewer) topology.
5. If mean_entropy < 30: the model is already confident.
Single agent is likely sufficient. Multi-agent adds latency
without meaningful accuracy gain.
Decision framework:
```python
def should_use_multi_agent(base_entropies: list[float]) -> str:
avg = np.mean(base_entropies)
if avg > 80:
return "single-agent (base model too uncertain for MAS benefit)"
elif avg > 30:
return "multi-agent (moderate uncertainty, MAS can help)"
else:
return "single-agent (model already confident)"
Example 3: Early-exit from a failing multi-agent pipeline
User: My sequential agent pipeline (planner -> solver -> critic -> judger)
sometimes wastes tokens on problems it gets wrong anyway. Can I detect
failure early?
Approach:
1. After the planner (round 1) generates its output, compute its
mean token entropy and max token entropy.
2. Compare against historical thresholds from your labeled data:
- If round-1 max_entropy > threshold_high: abort and return
single-agent fallback (saves 3 agent calls).
- If round-1 mean_entropy < threshold_low: skip critic/judger,
the solver's answer is likely already correct.
3. Only continue the full pipeline for moderate-entropy cases
where multi-agent deliberation adds value.
Implementation:
```python
def early_exit_check(round1_entropies: list[float],
high_threshold: float = 120.0,
low_threshold: float = 15.0) -> str:
max_ent = max(round1_entropies)
mean_ent = np.mean(round1_entropies)
if max_ent > high_threshold:
return "abort" # Fall back to single agent
elif mean_ent < low_threshold:
return "accept" # Skip remaining agents, answer is confident
else:
return "continue" # Proceed with full pipeline
Best Practices
- Do measure entropy from the actual token logits/log-probs, not from proxy signals like response length or verbosity. Entropy computed from the probability distribution over the vocabulary is the true uncertainty signal.
- Do weight round-1 features most heavily in any selection or diagnostic scheme. The paper shows first-round entropy is consistently the top predictor across all topologies and tasks.
- Do always benchmark against a single-agent baseline before deploying a multi-agent system. In 43% of cases, a single agent wins -- you need evidence that your multi-agent setup beats it.
- Do use task-specific entropy thresholds. Math reasoning tasks show tight entropy-correctness correlation (rho ~ -0.92), while code generation is weaker. Calibrate thresholds per task domain.
- Avoid adding more communication rounds hoping to "converge" when round-1 entropy is already high. The paper shows extended deliberation rarely recovers from poor initial uncertainty.
- Avoid using multi-agent systems with base models that show very high intrinsic entropy (>100 nats average). Fix the base model or prompting first -- multi-agent amplifies base model quality, it does not compensate for it.
Error Handling
- No logit access: If using a closed API (e.g., GPT-4, Claude) that doesn't expose token logits, approximate entropy using: (a) log-probabilities if available via the API, (b) self-consistency across k samples as a proxy for uncertainty, or (c) ask the model to self-rate confidence and treat low-confidence as high entropy. The heuristic degrades gracefully.
- Feature extraction fails for short responses: Very short outputs (< 5 tokens) produce unstable entropy statistics. Pad the feature vector with the sample mean or flag these as low-confidence and default to the single-agent answer.
- Classifier overfits to one task domain: The Entropy Judger should be trained per-task or per-domain. A classifier trained on math problems will not transfer well to code generation. Use the Task Awareness principle -- always retrain or recalibrate when switching domains.
- Inconsistent entropy scales across models: Different LLMs have different vocabulary sizes, which affects raw entropy magnitude. Normalize entropy features by
log(vocab_size) to make them comparable across models.
Limitations
- Requires access to token-level logits or log-probabilities. Many commercial APIs do not expose these, limiting the technique to open-weight models or APIs with logprob support.
- The supervised Entropy Judger (XGBoost + LightGBM ensemble) requires labeled training data -- you need a set of (input, agent_run, correct/incorrect) examples to train on. The heuristic fallback (lowest entropy wins) works without labels but is less accurate.
- Entropy is a necessary but not sufficient signal. A model can be confidently wrong (low entropy, incorrect answer). The technique improves selection accuracy, it does not guarantee correctness.
- The 245-feature set was validated on math (GSM8K, AIME, MATH-500), reasoning (MMLU), and code (HumanEval) benchmarks. Performance on creative, open-ended, or subjective tasks is unvalidated.
- The approach optimizes selection from existing candidates. It does not improve the generation quality of any individual agent -- it picks the best from what is already produced.
Reference
Zhao, Y., Chen, S., & Su, N. (2026). "On the Uncertainty of Large Language Model-Based Multi-Agent Systems." arXiv:2602.04234v2. https://arxiv.org/abs/2602.04234v2
Look for: Section 4 (Entropy Judger algorithm and feature taxonomy), Table 1 (cross-validation accuracy by feature group), and Section 3 (the three key observations on Certainty Preference, Base Uncertainty, and Task Awareness). Source code: https://github.com/AgenticFinLab/multiagent-entropy
1---2name: on-uncertainty-model-based-multi-agent3description: Apply entropy-based uncertainty analysis to multi-agent LLM systems. Diagnose when multi-agent setups hurt performance, select the best solution from multiple agent runs using the Entropy Judger technique, and design uncertainty-aware agent topologies. Trigger phrases: 'analyze multi-agent uncertainty', 'entropy judger for agent selection', 'should I use multiple agents or one', 'select best answer from agent runs', 'diagnose multi-agent failure', 'optimize agent topology with entropy'4---56# Entropy-Based Uncertainty Analysis for Multi-Agent LLM Systems78This skill enables Claude to apply the Entropy Judger framework from Zhao et al. (2026) to diagnose, evaluate, and improve multi-agent LLM systems. The core technique uses token-level, trajectory-level, and round-level entropy measurements to predict whether a multi-agent configuration will outperform a single agent, select the best solution from multiple runs (pass@k), and identify failure modes early in agent interactions. A critical finding: a single agent outperforms multi-agent systems in ~43% of cases, and first-round entropy dynamics are the strongest predictor of final correctness.910## When to Use1112- When the user is building a multi-agent system and wants to know whether multiple agents will actually help versus a single agent13- When the user has multiple candidate outputs from agent runs and needs to select the best one without ground truth14- When debugging why a multi-agent pipeline (debate, sequential, centralized) produces worse answers than expected15- When designing agent topologies (sequential, centralized, decentralized, debate, hybrid) and choosing which fits a task16- When the user wants to add an entropy-based quality gate to filter or rank LLM outputs before returning them17- When evaluating whether to add more agents or communication rounds to an existing system1819## Key Technique2021**The Entropy Judger** reframes multi-agent solution selection as a supervised classification problem: given entropy traces from an agent run, predict whether the output is correct. For each candidate solution in a pass@k set, extract a feature vector of entropy statistics across tokens, reasoning trajectories, and communication rounds. An ensemble of XGBoost and LightGBM classifiers scores each candidate f(x) in [0,1], and the candidate with the highest predicted correctness probability is selected: `best = argmax over k candidates of f(x_k)`.2223The method rests on three empirically validated observations. **Certainty Preference**: reducing entropy at any stage for any agent correlates with correct solutions -- high peak entropy is universally harmful. **Base Uncertainty**: the foundation model's intrinsic entropy during problem-solving directly bounds multi-agent performance -- if the base model is highly uncertain (entropy > 100 nats across the sequence), adding agents rarely helps. **Task Awareness**: entropy dynamics play different roles across task types -- math tasks show strong entropy-correctness correlation (rho up to -0.92), while code generation tasks show weaker but still useful signal.2425The practical implication is that first-round entropy dominates prediction. Round-1 maximum agent entropy is consistently among the top predictive features. Extended deliberation (5+ rounds) rarely overcomes poor initial uncertainty. This means you can make go/no-go decisions about an agent run very early.2627## Step-by-Step Workflow28291. **Define the agent topology.** Choose from: single agent, sequential (planner -> solver -> critic -> judger), centralized (domain agents + coordinator), decentralized (agents with feedback loops), full-decentralized (complete graph), debate (multi-agent voting), or hybrid (two-layer with context propagation). Default to single agent unless the task demonstrably benefits from decomposition.30312. **Instrument entropy collection.** For each LLM call in the pipeline, capture the raw logits or log-probabilities for every generated token. Compute per-token entropy as `H(t) = -sum(p(v) * log(p(v)))` over the vocabulary dimension. Store these as arrays alongside the generated text.32333. **Compute trajectory-level features.** For each agent's response, aggregate token entropies into: total_entropy, mean_entropy, max_entropy, min_entropy, median_entropy, std_entropy, q1/q3 entropy, coefficient of variation, IQR, skewness, and tail weight. This yields ~13 core features per agent response.34354. **Compute round-level transition features.** Across communication rounds, track: first-to-last round entropy difference, entropy slope (linear trend), volatility (std of per-round means), and per-round agent spread (max - min entropy across agents in a round). Focus especially on round-1 metrics -- they carry the most predictive signal.36375. **Extract base-model reference entropy.** Run the same prompt through a single agent with the same base model. Compute its entropy features as a baseline. Calculate deltas and ratios: `delta_mean = mas_mean_entropy - base_mean_entropy`, `ratio_total = mas_total_entropy / base_total_entropy`. These ~17 features capture whether the multi-agent setup is increasing or decreasing uncertainty relative to the base model.38396. **Build the feature vector.** Concatenate sample-level (~13), shape (~7), round-agent (~100+), cross-round dynamics (~20), answer-token (~12), agent-level (~10), base-model comparison (~17), and computational metrics (~15 for time/tokens) into a single vector per candidate solution. The full set is 245 features.40417. **Train or apply the Entropy Judger classifier.** If you have labeled data (correct/incorrect for past runs), train an XGBoost + LightGBM ensemble on the feature vectors. Use 5-fold cross-validation. If no labeled data is available, use a heuristic: select the candidate with the lowest mean entropy and lowest round-1 max entropy -- the Certainty Preference principle.42438. **Select from pass@k candidates.** Run the multi-agent system k times on the same input. Score each candidate with the trained classifier (or heuristic). Return the candidate with highest predicted correctness: `best = argmax_k f(x_k)`.44459. **Apply early-exit logic.** After round 1, check if max agent entropy exceeds your task-specific threshold (e.g., >100 nats for math tasks). If so, consider falling back to a single-agent solution rather than continuing multi-round deliberation, which is unlikely to recover.464710. **Iterate on topology.** If the Entropy Judger consistently scores single-agent runs higher than multi-agent runs for your task, simplify the topology. Multi-agent systems add value primarily when base model uncertainty is moderate and the task benefits from decomposition (e.g., complex multi-step reasoning).4849## Concrete Examples5051**Example 1: Selecting the best answer from multiple agent debate runs**5253```54User: I'm running a 3-agent debate system on math problems and generating555 candidate answers per problem. How do I pick the best one?5657Approach:581. For each of the 5 runs, collect per-token entropy from every agent59 at every debate round.602. Compute per-run feature vectors:61 - mean_entropy across all agents and rounds62 - max_entropy in round 1 (strongest single predictor)63 - entropy_slope across rounds (is uncertainty decreasing?)64 - std_entropy across agents in final round (consensus measure)653. Rank candidates by: lowest round-1 max entropy first, then by66 most negative entropy slope (uncertainty decreased most).674. Return the top-ranked candidate.6869Output (selection logic in Python):70```python71import numpy as np7273def select_best_candidate(candidates):74 """Select best from pass@k using entropy heuristic.7576 Each candidate is a dict with:77 - 'answer': str78 - 'round_entropies': list of list of float79 (rounds x agents, each entry is mean token entropy)80 """81 scores = []82 for c in candidates:83 r1_max = max(c['round_entropies'][0]) # round-1 max agent entropy84 all_means = [np.mean(r) for r in c['round_entropies']]85 slope = all_means[-1] - all_means[0] # negative = uncertainty decreased86 final_std = np.std(c['round_entropies'][-1]) # agent consensus87 # Lower is better for all three components88 score = r1_max + 0.5 * slope + 0.3 * final_std89 scores.append(score)90 return candidates[np.argmin(scores)]['answer']91```9293**Example 2: Deciding whether to use multi-agent or single-agent**9495```96User: I have a code generation task. Should I use a multi-agent system97or just a single agent?9899Approach:1001. Run 20 sample problems through a single agent, collecting entropy.1012. Compute the base model's average mean_entropy across samples.1023. If mean_entropy > 80 nats: the base model is highly uncertain.103 Multi-agent is unlikely to help (Base Uncertainty principle).104 Invest in a better base model or better prompting first.1054. If mean_entropy is moderate (30-80): multi-agent may help.106 Try a sequential (planner -> coder -> reviewer) topology.1075. If mean_entropy < 30: the model is already confident.108 Single agent is likely sufficient. Multi-agent adds latency109 without meaningful accuracy gain.110111Decision framework:112```python113def should_use_multi_agent(base_entropies: list[float]) -> str:114 avg = np.mean(base_entropies)115 if avg > 80:116 return "single-agent (base model too uncertain for MAS benefit)"117 elif avg > 30:118 return "multi-agent (moderate uncertainty, MAS can help)"119 else:120 return "single-agent (model already confident)"121```122123**Example 3: Early-exit from a failing multi-agent pipeline**124125```126User: My sequential agent pipeline (planner -> solver -> critic -> judger)127sometimes wastes tokens on problems it gets wrong anyway. Can I detect128failure early?129130Approach:1311. After the planner (round 1) generates its output, compute its132 mean token entropy and max token entropy.1332. Compare against historical thresholds from your labeled data:134 - If round-1 max_entropy > threshold_high: abort and return135 single-agent fallback (saves 3 agent calls).136 - If round-1 mean_entropy < threshold_low: skip critic/judger,137 the solver's answer is likely already correct.1383. Only continue the full pipeline for moderate-entropy cases139 where multi-agent deliberation adds value.140141Implementation:142```python143def early_exit_check(round1_entropies: list[float],144 high_threshold: float = 120.0,145 low_threshold: float = 15.0) -> str:146 max_ent = max(round1_entropies)147 mean_ent = np.mean(round1_entropies)148 if max_ent > high_threshold:149 return "abort" # Fall back to single agent150 elif mean_ent < low_threshold:151 return "accept" # Skip remaining agents, answer is confident152 else:153 return "continue" # Proceed with full pipeline154```155156## Best Practices157158- **Do** measure entropy from the actual token logits/log-probs, not from proxy signals like response length or verbosity. Entropy computed from the probability distribution over the vocabulary is the true uncertainty signal.159- **Do** weight round-1 features most heavily in any selection or diagnostic scheme. The paper shows first-round entropy is consistently the top predictor across all topologies and tasks.160- **Do** always benchmark against a single-agent baseline before deploying a multi-agent system. In 43% of cases, a single agent wins -- you need evidence that your multi-agent setup beats it.161- **Do** use task-specific entropy thresholds. Math reasoning tasks show tight entropy-correctness correlation (rho ~ -0.92), while code generation is weaker. Calibrate thresholds per task domain.162- **Avoid** adding more communication rounds hoping to "converge" when round-1 entropy is already high. The paper shows extended deliberation rarely recovers from poor initial uncertainty.163- **Avoid** using multi-agent systems with base models that show very high intrinsic entropy (>100 nats average). Fix the base model or prompting first -- multi-agent amplifies base model quality, it does not compensate for it.164165## Error Handling166167- **No logit access**: If using a closed API (e.g., GPT-4, Claude) that doesn't expose token logits, approximate entropy using: (a) log-probabilities if available via the API, (b) self-consistency across k samples as a proxy for uncertainty, or (c) ask the model to self-rate confidence and treat low-confidence as high entropy. The heuristic degrades gracefully.168- **Feature extraction fails for short responses**: Very short outputs (< 5 tokens) produce unstable entropy statistics. Pad the feature vector with the sample mean or flag these as low-confidence and default to the single-agent answer.169- **Classifier overfits to one task domain**: The Entropy Judger should be trained per-task or per-domain. A classifier trained on math problems will not transfer well to code generation. Use the Task Awareness principle -- always retrain or recalibrate when switching domains.170- **Inconsistent entropy scales across models**: Different LLMs have different vocabulary sizes, which affects raw entropy magnitude. Normalize entropy features by `log(vocab_size)` to make them comparable across models.171172## Limitations173174- Requires access to token-level logits or log-probabilities. Many commercial APIs do not expose these, limiting the technique to open-weight models or APIs with logprob support.175- The supervised Entropy Judger (XGBoost + LightGBM ensemble) requires labeled training data -- you need a set of (input, agent_run, correct/incorrect) examples to train on. The heuristic fallback (lowest entropy wins) works without labels but is less accurate.176- Entropy is a necessary but not sufficient signal. A model can be confidently wrong (low entropy, incorrect answer). The technique improves selection accuracy, it does not guarantee correctness.177- The 245-feature set was validated on math (GSM8K, AIME, MATH-500), reasoning (MMLU), and code (HumanEval) benchmarks. Performance on creative, open-ended, or subjective tasks is unvalidated.178- The approach optimizes selection from existing candidates. It does not improve the generation quality of any individual agent -- it picks the best from what is already produced.179180## Reference181182Zhao, Y., Chen, S., & Su, N. (2026). "On the Uncertainty of Large Language Model-Based Multi-Agent Systems." arXiv:2602.04234v2. [https://arxiv.org/abs/2602.04234v2](https://arxiv.org/abs/2602.04234v2)183184Look for: Section 4 (Entropy Judger algorithm and feature taxonomy), Table 1 (cross-validation accuracy by feature group), and Section 3 (the three key observations on Certainty Preference, Base Uncertainty, and Task Awareness). Source code: [https://github.com/AgenticFinLab/multiagent-entropy](https://github.com/AgenticFinLab/multiagent-entropy)