World Cup 2026 Predictor by Qwen

Inspiration

Billions of people watch the World Cup. A small fraction follow the statistics. Almost none can access both at once — a prediction engine that doesn't just produce a number, but explains why.

The tools that exist sit at two unsatisfying extremes: crude heuristics with no accountability, or opaque ML models with none either. Neither earns trust. Neither teaches you anything about the game.

WC 2026 raised the stakes. The tournament expands to 48 teams and 104 matches for the first time — a complexity that overwhelms casual analysis. So I set myself a challenge: build the same predictor six times, with six different AI coding tools, and let the tournament results decide the winner.

I shipped versions powered by Claude Code (Sonnet 4.6), Codex (GPT-5.5), Amazon Kiro, and Google Antigravity (Gemini 3.5 Flash) and of course, a version built with Qwen's model family. Every version uses the same statistical backbone, the same data sources, and the same deployment target. The only variable is the AI doing the building and reasoning.

After the Group Stage has ended, and before Round of 32, Qwen's version leads the leaderboard.

What made the difference wasn't raw code generation — all six tools produced working apps. It was architecture. Qwen's tiered model family (qwen-max, qwen-plus, qwen-turbo) made it natural to assign different reasoning models to different analytical roles. That unlocked the idea: don't build one AI analyst. Build a panel. A statistician, a scout, a journalist, and a tactician would disagree — and the final view would be better because of that disagreement. Adversarial reasoning, not consensus averaging, is what produces genuinely calibrated predictions.


What it does

World Cup 2026 Predictor by Qwen covers the entire tournament — all 48 teams, 72 group stage fixtures, and every knockout match through to the Final — powered by a five-agent Qwen AI system where every prediction is the result of specialists debating each other.

Dashboard — tournament phase, today's matches with win/draw/loss probabilities, and a tournament winner leaderboard from 50,000-simulation Monte Carlo.

Match Detail — expected score, top-3 most likely scorelines, and a full agent dialogue viewer: each specialist's Round 1 output, detected conflicts, Round 2 rebuttals, and how the negotiation resolved. The AI's reasoning is completely auditable.

Group Standings — live points tables with qualification indicators and a what-if scenario calculator for every remaining group match.

Knockout Bracket — visual bracket that fills in as teams advance, clearly distinguishing confirmed results from predicted outcomes.

Predictions — every forecast vs. actual result with running accuracy and Brier score calibration metrics.

Team Profiles — group context, full match history, and ELO rating trajectory across the tournament.

Built mobile-first, with dark/light theme, English/中文 bilingual support, and all times in Singapore Time (SGT/UTC+8).


How I built it

The Statistical Backbone

Every prediction starts with a Dixon-Coles bivariate Poisson model — the standard in football analytics since 1997. Each team carries attack ($\alpha_i$) and defensive weakness ($\beta_i$) parameters, updated online after every completed match. Expected goals are:

$$\lambda_{\text{home}} = \exp!\left(\log\alpha_H + \log\beta_A + \delta_{\text{home}}\right), \qquad \lambda_{\text{away}} = \exp!\left(\log\alpha_A + \log\beta_H\right)$$

A $9 \times 9$ scoreline matrix is built with the $\tau$ low-score correction, fixing independent Poisson's tendency to over-predict 1–1 draws. Win/draw/loss probabilities and scoreline picks both derive from this same matrix — so the two are always internally consistent. Goal-rate scalars ($0.82\times$ group stage, $0.72\times$ knockout) calibrate to WC-level scoring, which is measurably more cagey than general international football.

Five signals then adjust the backbone via log-pooling (geometric mean in probability space, not arithmetic average):

$$P_{\text{final}} \propto \prod_k P_k^{w_k}$$

Signal Weight Source
Head-to-head history $w = 0.30$ 47,000+ international results since 1872
Recent form $w = 0.20$ Last 10 matches, competition-weighted
Pre-match intelligence $w = 0.20$ Google News RSS + Qwen extraction
Confirmed lineup $w = 0.40$ football-data.org, ~60 min pre-kickoff
Rest-days difference $w = 0.10$ Match schedule

Log-pooling was a deliberate choice. Arithmetic averaging regresses every ensemble toward $(0.33, 0.33, 0.33)$ — the more signals you add, the more confident predictions collapse toward noise. Log-pooling treats uninformative signals as near-zero contributions and preserves the sharpness of genuinely informative ones.

The Five Specialist Agents

When multi-agent mode is active, the backbone hands off to five Qwen specialists — each with the same match context but a different analytical brief:

Agent Model Domain
StatisticalAgent qwen-plus Dixon-Coles $\lambda$ values, ELO gap, $\alpha/\beta$ ratings
FormAgent qwen-turbo Last 10 results, competition-weighted
H2HAgent qwen-turbo Head-to-head history; auto-skips if fewer than 2 meetings
IntelAgent qwen-plus Injuries, suspensions, rotation, motivation from news
LineupAgent qwen-plus Confirmed starting XI strength; activates ~60 min pre-kickoff

qwen-turbo handles high-throughput form and H2H analysis. qwen-plus handles nuanced statistical, intel, and lineup work. qwen-max powers the OrchestratorAgent — the model that synthesises all five, detects disagreements, and runs negotiation.

The Negotiation Protocol

When two agents diverge by more than 20 percentage points on any outcome, a second round fires:

  1. Round 1 — all five agents run in parallel, each producing a probability estimate with evidence
  2. Conflict detection — pairwise deltas checked; any pair with $\Delta \geq 0.20$ enters negotiation
  3. Round 2 (Rebuttal) — each conflicting agent receives the other's evidence and defends or revises
  4. Weight adjustment — the agent that moves less wins: $1.3\times$ boost for the winner, $0.6\times$ cut for the one who conceded

This penalises overconfidence and rewards agents that identified a signal others missed. The final output is a log-pool of all five adjusted outputs, passed through a temperature scalar $T$ fit by minimising negative log-likelihood on completed match results.

Stack

  • Backend — Node.js, Express, SQLite (WAL mode)
  • Frontend — React 18, Vite, Tailwind CSS
  • AI — Alibaba Cloud DashScope: qwen-max, qwen-plus, qwen-turbo
  • Data — football-data.org (live scores, lineups), 47k-match H2H dataset, Google News RSS
  • Deployment — Alibaba Cloud ECS, Docker Compose; setup-ecs.sh automates VPC, security group, and instance provisioning end-to-end

Challenges I ran into

Circular dependency between the prediction engine and orchestrator. The engine imports the orchestrator (to invoke agents); the orchestrator imports the engine (for Dixon-Coles matrix math). CommonJS partially resolves this, leaving the required function undefined at load time. Fix: lazy-load the orchestrator inside a getter called only at prediction time.

Keeping agents on the JSON schema. Under load, qwen-turbo will wrap JSON in prose or drop a required field. I built a fallback chain — fenced JSON → bare object regex → graceful uniform-prior — and normalised all probability outputs to sum exactly to 1.0. A parse-error agent's weight drops to near-zero; it doesn't corrupt the blend.

Calibrating the negotiation threshold. At 10%, every pair triggered Round 2, latency tripled, and outcomes barely changed — negotiating on noise. At 30%, real disagreements went unresolved. At 20%, negotiation fires on roughly 30% of matches: the genuine cases where the statistical backbone and form/intel signals actually diverge.

Third-place bracket seeding. The WC 2026 R32 bracket maps all 495 possible combinations of qualifying third-place teams to specific slots via the official FIFA table. Implementing this correctly — and wiring it into bracket auto-progression — was painstaking, with no room for edge-case errors.

Calibration cold-start. Temperature scaling requires results to fit against. Below 15 completed matches, it's bypassed entirely. I clamped the learnable range to $[0.5, 2.5]$ to prevent runaway values from corrupting predictions in the tournament's first week.


Accomplishments that we're proud of

Leading a six-way benchmark. I built the same predictor with six different AI coding tools and tracked prediction accuracy across every completed WC 2026 match. As of 21 June 2026, Qwen's version sits at the top:

Tool Live App
🥇 Qwen (this project) qwen.wc2026ai.com
Claude Code (Sonnet 4.6) claudecode.wc2026ai.com
Codex (GPT-5.5) codex.wc2026ai.com
Amazon Kiro (Auto mode) amazonkiro.wc2026ai.com
IBM Bob ibmbob.wc2026ai.com
Google Antigravity (Gemini 3.5 Flash) antigravity.wc2026ai.com

All six share the same statistical backbone and data sources. The performance gap comes from architecture — specifically, the five-agent negotiation system that no single-model approach could replicate.

The negotiation actually changes outcomes. In roughly 12% of matches where Round 2 fires, the weight adjustment shifts the final probability by more than 5 percentage points. The StatisticalAgent holding a large ELO gap against a FormAgent chasing a hot streak is the canonical case — and it's the model making the right call.

Fully auditable AI. Every Match Detail page shows the exact agent dialogue: what each specialist argued in Round 1, which pairs conflicted, how the rebuttal round resolved, and the final weights. Users can see precisely why the model thinks what it thinks — the opposite of a black box.

Internal consistency. The same scoreline matrix that produces win/draw/loss probabilities also produces the top-3 scoreline picks. It's impossible for the model to list a "0–1" as most likely while also showing 60% home win probability. This seems obvious — but it's surprisingly rare in public prediction tools.

Real calibration improving over time. Online temperature scaling and Dixon-Coles $\rho$ refit improved the Brier score by ~8% over the uncalibrated baseline by match 30 — meaningful improvement from a model that was already well-tuned.

One-command deployment. bash setup-ecs.sh creates a full Alibaba Cloud environment — VPC, security group, ECS instance, Docker — and deploys the app. No manual console steps.


What I learned

Log-pooling, not arithmetic averaging. Arithmetic blending systematically drags predictions toward the uniform prior. Log-pooling preserves signal sharpness and correctly treats missing or uninformative agents as near-zero contributors. This was the single biggest modelling improvement I made.

Model tier = analytical role. qwen-turbo is crisp and cost-effective for well-defined lookups. qwen-plus produces richer reasoning chains for nuanced signals. qwen-max reasons structurally about disagreements between agents in ways the smaller models can't. Matching the right tier to the right role mattered more than I expected.

The $\rho$ parameter is tournament-specific. Generic Dixon-Coles implementations use $\rho = -0.13$. World Cup football is more cagey — teams protect leads, rotations are conservative. Fitting on 2018 and 2022 WC group data gives $\rho = -0.18$, which noticeably improves the low-score distribution. A small number with a real effect.

Calibration pays off even with few samples. I doubted temperature scaling would add value early in a tournament. In practice, even a noisy $T$ estimate corrected systematic overconfidence in lopsided matchups. The cold-start bypass below 15 results was the right guardrail; above it, the signal is real.


What's next for World Cup 2026 Predictor by Qwen

Live agent streaming — push each agent's output to the frontend as it arrives so users watch the panel debate in real time, rather than waiting for the full prediction.

Per-agent accuracy tracking — grade each specialist after every result and build long-run performance priors. Agents that prove more accurate in this tournament should earn higher baseline weights in the next.

Player-level intelligence — the IntelAgent currently works at team level. A proper player-stats layer (market value, positional coverage, replacement quality) would sharpen both the lineup and intel signals significantly.

Confidence-gated predictions — when no signal dominates and uncertainty is genuinely high (two evenly-matched teams, neutral venue, no H2H history), the model should surface an explicit "too close to call" flag rather than pretend to precision it doesn't have.

Multi-tournament expansion — the Dixon-Coles backbone, the agent framework, and the negotiation protocol are all tournament-agnostic. The natural next step is packaging the system for UEFA Euro, Copa América, and World Cup qualifying campaigns.

Built With

Share this project:

Updates