Views
No views yet
[0, 99999]), a structured problem-solving protocol (Parse, Explore, Plan, Execute, Verify), and a pre-\boxed{} checklist to reduce common errors.\boxed{} is scanned on a rolling window
of streaming tokens so an answer can be captured as soon as it is written,
without waiting for the full generation to complete.kaggle block has been stripped
from the notebook metadata. Paths referencing /kaggle/input/ and
/kaggle/tmp/ are clearly marked and must be updated for your own
environment (see Configuration below).[0, 99999]
answer range, modular arithmetic framing, and a mandatory self-check step
before boxing the final answer._scan_for_answer now handles
\boxed{42,000} (comma thousands-separators) and \boxed{ 42 } (extra
whitespace)._select_answer combines raw majority vote,
entropy-weighted vote, and a consensus bonus rather than a pure
entropy-weighted sum.logprob_tail) rather than the full generation._can_remaining_change_winner to
halt sampling once the leader is uncatchable by the second-place answer.| Dependency | Notes |
|---|---|
| Python ≥ 3.11 | Type hints use X | Y union syntax |
vllm | Serves the model via an OpenAI-compatible endpoint |
unsloth | Optional; used for training (not inference) |
trl | Optional; used for training (not inference) |
openai | Python client for the vLLM endpoint |
openai_harmony | Custom tokeniser / conversation-format library (see below) |
jupyter_client | Manages the sandboxed Jupyter kernels |
transformers | set_seed utility |
pandas, polars | Result aggregation and display |
sympy, numpy, mpmath | Available inside the solver's code sandbox |
openai_harmonyis a proprietary library distributed as a wheel inside the original competition dataset (/kaggle/input/aimo-3-utils/wheels.tar.gz). You will need access to that archive (or a compatible replacement) to run the notebook as-is.
| Component | Minimum | Recommended |
|---|---|---|
| GPU | 1 × A100 80 GB | 1 × H100 80 GB (SXM or PCIe) |
| GPU VRAM | 80 GB | 80 GB |
| System RAM | 128 GB | 256 GB |
| Disk (model weights) | ~240 GB free | NVMe SSD for fast weight preloading |
| CPU cores | 16 | 32+ (parallel Jupyter kernel pool) |
CFG class at the top of the notebook.
The most important ones to update when running outside Kaggle:1class CFG:
2 kv_cache_dtype = 'fp8_e4m3' # requires H100/A100 with FP8 support; change to 'auto' otherwise
3 attempts = 8 # parallel inference attempts per problem
4 workers = 16 # Jupyter kernel pool size (set ≤ GPU-concurrent capacity)
5 context_tokens = 65536 # max context length passed to vLLMset_env call and the paths inside predict / the
inference_server block if you are not using the Kaggle dataset structure.CFG.model_path to point to your local copy of GPT-OSS 120B (or
a compatible model).localhost:8000.predict() for each problem in the dataset.inference_server.serve() / run_local_gateway() block with direct calls
to solver.solve_problem(your_problem_text)..
└── aimo3-2nd-place-solution-adapted.ipynb # Main notebookAI Mathematical Olympiad Progress Prize 3 (AIMO3), Kaggle, 2025.
2nd place solution — adapted for use outside the Kaggle environment.openai_harmony library are subject to
their own respective licenses. Please consult the original competition materials
for details.