GigaChat-3.1: A large update to large-scale models
Nikita Sushko
ML engineer
In November, we open-sourced the preview versions of GigaChat-3-Ultra (702B MoE) and GigaChat-3-Lightning (10B MoE). Since then we've put a lot of work into our models, and today we're releasing the updated GigaChat-3.1-Ultra and GigaChat-3.1-Lightning. By our measurements, Ultra beats non-reasoning Qwen3-235B-A22B and DeepSeek-V3-0324 in math and general reasoning, while Lightning performs on par with GPT-4o on arenas judged by GPT-4.1, with 1.8B active parameters. As before, the models are available on HuggingFace and GitVerse under the MIT license.

But this post isn't just about numbers in tables. Moving to the new architecture wasn't easy: the switch from dense models to MoE exposed several problems we had never thought about before. On the way to the release, we completely defeated generation looping (and came up with a metric for it based on BPE compression of the tail), moved the DPO stage to native FP8 — getting quality above bf16 with half the memory footprint — found a critical bug in SGLang with dp > 1 that tanks quality, and discovered that GPT-OSS-120b is a surprisingly good substitute for proprietary judges on arenas. Below are the details of each of these stories: what broke, which hypotheses didn't pan out, and what eventually helped.
How we fought loops
The release of these models was originally scheduled for the end of January, and we had them ready on time. But validation showed that the entire model lineup was looping heavily — this showed up both in arena metrics, generations and in our dedicated looping metrics. The loops came in different shapes: simple ones, where the model just started repeating the same word over and over, and more complex ones. For example:
…The tropics. Scorching sun. Palm trees. Palm trees. Palm trees. And heat, heat, heat. And ocean, ocean, ocean. And sand, sand, sand. And coconuts, coconuts, coconuts. And pineapples, pineapples, pineapples. And bananas, bananas, bananas…
We couldn't market anything like that, so we decided to postpone the release, find the root cause, and deal with the problem.
About the metrics
You can't solve a problem you can't measure. We originally had several metrics for measuring loops, but our target metric was CYCLES. It consisted of a set of samples on which models often looped and a script that counted loops using the Z function. While loops weren't a pressing issue, CYCLES worked fine, but they didn't show the whole picture. So we decided to build a new metric that would be both faster (the Z function on long sequences could run for a VERY long time) and more representative.
The idea for the metric came from an everyday observation: if a model has looped, the end of the generation usually consists of repeating fragments and should therefore compress well. If the tail is normal, diverse, and non-degenerate, there's nothing to compress.
To compute our metric, we tokenize the text of each generation and take only the tail, either of fixed length or as a fraction of the whole sequence. We then run a BPE-like procedure on this tail: we iteratively find the most frequent token pairs and merge them into a single super token. If the tail contains many repeating patterns, these merge operations shorten the text considerably, but for a normal generation the compression gain is small. The final metric is the ratio of the tail length after this BPE-like compression to its original length:

The lower this value, the more regular and repetitive the tail. If compression_ratio falls below a set threshold, we consider the generation looped.
Importantly, this heuristic spots both the most blatant cases, where the model literally repeats the same word or sentence, and also more complex loops — for example, repeated template-like syntactic constructions, code fragments, lists, or slightly drifting text blocks. We don't try to guess the shape of a loop in advance; we simply measure how much the generation tail reduces to a limited set of repeating chunks.
In our experiments, we looked at the number of spotted loops but also at generation lengths. This turned out to be useful, because a short annoying repeat at the very end and a long, completely collapsed tail are problems of different severity, and a simple binary flag doesn't always capture that.
How we hunted for the problem
To understand what was causing the loops, we split our pipeline into parts and checked at which point critical looping issues appear. Here's what we checked:
Data issues. The first thing that comes to mind is that the data contains samples that make the model loop — or, conversely, lacks samples that keep it from looping. After several rounds of re-checking our SFT and DPO sets, we concluded that the data was fine. What's more, the DPO set contains anti-looping samples that helped the model loop less, so that stage turned out to be key to solving the problem — and the data itself were OK.
EOS prediction issues. Our second hypothesis was that the model doesn't learn to predict the EOS token during training. We checked the data again and started measuring the probability of generating the EOS token at every step. The results showed that most looped generations never stop and run into the maximum length limit. In loop-free answers the EOS probability rises toward the end, while in problematic cases it plateaus at an almost constant level, or rises too late and too weakly, which leads to looping. This indicates that the problem isn't that EOS is unlearnable, but that the stopping mechanism is unstable: the model does have an end-of-answer signal, but on some trajectories it can't override a loop that has already started.
Expert balancing. Training MoE models is a tricky business. One of the main headaches is load balancing between experts. If it breaks, the whole signal goes to one of many experts and the model loses capacity, so we get no benefit from scaling parameters, because relatively small experts can't memorize all the information routed to them.
One hypothesis for why our models started looping was that the SFT stage was breaking expert balance. After all, the distribution changes dramatically at SFT compared to pretraining: the text stops being unstructured. On top of that, padding appears during SFT, and it also has to be accounted for when computing balancing statistics. For example, when computing statistics for the specialized loss that balances expert load within a single request (sequence auxiliary loss) in SFT mode with sequence_parallelism, a simple all_reduce for averaging across ranks is not enough — you need to account for the number of tokens from each rank when weighting the mean.
Finally, at the SFT stage, the loss isn't computed over all tokens: the request prefix is masked, and training happens only on the desired model answers. Moreover, the non-trainable prefixes usually share similar patterns (the system prompt, for example). All this makes you wonder: should expert load be balanced over all tokens, or is it better to balance only over trainable tokens and ignore system prompts?
While preparing the new SFT stage, we took all of the above into account and ran a series of experiments, trying to reduce (and even completely turn off!) DeepSeek-like balancing (the loss-free approach and sequence auxiliary loss) and to exclude padding and prefix tokens from balancing. It turned out that the model adapts to the new data distribution fairly quickly and stabilizes balancing on its own, while extra balancing hurts the quality of the final model, so we didn't use it. Balancing ended up working great, and it wasn't the cause of the loops.
At which stage do loops appear? The next step was to check at which training stage the looping problem arises. We measured CYCLES after each stage of the pipeline (pretrain → stage 1.5 → SFT → DPO), including the pretrain with a simple chat template the base model could follow. The key observation: the root of the problem is the context extension stage in pretraining. SFT with a 4096-token context barely loops, while SFT with a 32k context loops noticeably: more context means a higher chance of looping. All subsequent training stages only reduce the problem, with a pronounced cold-start effect: the fewer loops there were at the previous stage, the fewer remain at the next one. It's also worth noting that choosing hyperparameters well at each stage affected loops even more than the choice of data.
A bug in SGLang. While debugging loops and measuring metrics, we noticed something interesting: as DP increased, the number of loops in models (not only ours!) went up, while inference speed dropped significantly. After a bit of investigation, it turned out we had found a critical bug in SGLang that shows up with dp > 1 combined with batched API requests. In all versions from 0.5.3 up to the current 0.5.9, the model starts looping, repeating chunks of its generations, and computations get duplicated across all DP ranks, which skews measurement results. This was especially visible on coding tasks, where Qwen3-8B's HumanEval score dropped from 0.63 all the way to 0.43. On top of that, the bug negates the benefit of horizontal scaling on a single node, and for small models with DP=8 the share of redundant computation in total runtime becomes critical.
Technical details
To fix the bug, we've prepared a pull request for SGLang. Until it's merged, we recommend rolling back to versions older than 0.5.3. Steps to reproduce the bug:
Starting SGLang:
python -m SGLang.launch_server \
--model-path Qwen/Qwen3-8B-Base \
--tp 1 \
--dp 8 \
--host 0.0.0.0 \
--port 30000
Request to the server:
import requests
URL = "http://localhost:30000/generate"
TOKENS = [
1499, 19496, 1159, 1759, 1406, 750, 8651, 620, 9151, 21148, 49622, 3904,
25, 607, 8, 1464, 1759, 17303, 10343, 262, 4210, 5571, 311, 419, 729, 374,
264, 914, 8482, 5248, 5203, 315, 24034, 73975, 13, 4615, 5795, 374, 311,
198, 262, 8651, 1846, 1874, 1119, 8651, 9069, 323, 470, 279, 1140, 315,
1846, 624, 262, 76140, 5203, 525, 23831, 320, 9547, 1787, 32864, 374,
10277, 7877, 8, 323, 537, 24034, 2878, 1817, 1008, 198, 262, 38971, 894,
12621, 304, 279, 1946, 914, 624, 262, 12109, 8651, 620, 9151, 21148, 69963,
873, 1781, 11985, 1781, 40612, 11985, 1305, 262, 2509, 61413, 22022, 2140,
516, 364, 5065, 2140, 4432, 262, 3190, 257
]
SAMPLING_PARAMS = {
"max_new_tokens": 1024,
"temperature": 0.0,
"stop": ["\nclass", "\ndef", "\n#", "\nif", "\nprint", "<|endoftext|>"],
}
def send_request(batched: bool = False):
payload = {
"input_ids": [TOKENS] if batched else TOKENS,
"sampling_params": SAMPLING_PARAMS,
}
resp = requests.post(URL, json=payload, timeout=300)
print("status_code:", resp.status_code)
print(resp.text)
if __name__ == "__main__":
print("=== single [] ===")
send_request(batched=False)
print("\n=== batched [[]] ===")
send_request(batched=True)
TOKENS is a tokenized (with the Qwen3-8b-Base tokenizer) prompt of one of the tasks from the HumanEval dataset.
Hyperparameter search. The move to MoE required revisiting hyperparameters at every training stage — scaling laws from dense model training turned out not to transfer directly. At the SFT and Stage 1.5 stages, in addition to the balancing parameter search described above, we tried other learning rates and schedulers. One of the key differences from dense models turned out to be the models' sensitivity to the number of epochs. Progress was very slow — one experiment reached the target CYCLES value only after twenty (!) epochs — but it was there. Based on the experiments, we found that, for our model and datasets, it was optimal to raise the LR compared to our dense models and use a less decaying constant scheduler. This both improved the cold start for the DPO stage in terms of metrics and reduced the number of loops. The takeaway: hyperparameters that look optimal by benchmark metrics can produce artifacts such as loops, and MoE may have more of these traps.
DPO was the most important stage, because it had the most anti-looping samples, so the hyperparameter search at this stage was the most extensive. At the same time, DPO is very capricious: hyperparameters can either give the model a great boost on arenas and benchmarks and improve its overall behavior, or break the model by increasing loops — or even make it unlearn how to generate text. From the search, we found that:
- The larger the global batch size, the better. We trained the final models with a global batch size of 1024 or 512. Compared to smaller values, arenas, regular metrics, and — most importantly — looping metrics all went up.
- The bigger DPO's contribution (via a higher LR, dpo_loss_coef, or beta_chosen), the less the model loops — but the easier it breaks.
- Optimal hyperparameters differ across datasets and architectures. In particular, we had no looping problems before moving to MoE.
Of course, these aren't all the hypotheses and experiments we ran. Some hypotheses didn't fly. We retrained pretrained models on different subsets, trying to improve the cold start and understand how data affects loops. We compared our alignment pipelines with open-source ones and with our own from last year. We fixed bugs in metric measurements and in our templates. We tried to fix loops by changing sampling parameters: repetition/frequency penalties and temperature. But none of this gave a significant improvement, and only finer hyperparameter tuning for each training stage let us almost completely solve the looping problem. We hit 97.6 on CYCLES and improved BPE_CYCLES from 0.75 to 0.9. That means virtually no looping, even on hard examples.
Speeding up training
Training large models is expensive, so there's always ongoing work to improve GPU utilization and shorten experiment time. We optimized our SFT pipelines, speeding up training threefold compared to "naive training" by using cleverly tuned sequence packing, dynamic SP, and one more secret trick. With a 256k-token context, the speedup can reach tenfold.
Short and medium dialogs were packed into packs of up to 32k tokens, which sharply reduced padding and increased GPU utilization. We deliberately didn't switch the entire dataset to 128k/256k mode, because for most examples it adds no extra signal but noticeably increases the per-step cost in memory and communication. So we used large windows only where they're really needed — for dialogs longer than 32k tokens.
Dynamic sequence parallel complemented this scheme: instead of a single fixed level of sequence sharding for all batches, it adaptively chose the degree of parallelism for the actual pack length, reducing unnecessary communication on short examples and making it possible to efficiently train on ultra-long contexts.
The combination of these two tricks speeds up training roughly threefold. But we felt a much bigger speedup when, on top of dynamic SP and sequence packing, we dropped long (1000-token) devsystems in favor of short ones (300 tokens). Sometimes plain old data work helps just as much as complex and elegant engineering solutions :)
DPO
Ten months ago, in our post about GigaChat-2-Max, we already wrote about the DPO variant we use:

Compared to the standard DPO formulation, our loss can use different values of beta_chosen and beta_rejected to better balance the gap between bad and good answers, and we add the NLL ratio between the reference and trained models for better balancing.
GigaChat-3-Ultra-Preview and GigaChat-3-Lightning-Preview had no DPO, but in this release we brought this stage back with a few improvements, partly driven by the move to the new architecture:
- MTP: during pretraining and SFT, the model is trained with MTP blocks to speed up inference. For better consistency between the model's main predictions and MTP, we also trained the MTP heads during DPO. We used the same coefficient as in the pretraining and SFT stages.
- Weighted gamma: we added exponential decay as the sequence gets longer. Importantly, token down-weighting started only from the first differing tokens of the chosen and rejected examples.
As a result, our loss now looks like this:

This helped us avoid overfitting on overly long examples, which also reduced the number of loops.
Training in FP8
When we started experimenting with quantizing our language models, we used post-training quantization (PTQ) to FP8. This let us halve model size and speed up inference without much hassle. For a 702-billion-parameter titan like GigaChat-3-Ultra, this matters a lot: the less memory the model checkpoint takes, the lower the expert/tensor parallelism degree we can use, minimizing inter-node traffic and speeding up inference even more. And benchmark metrics barely seemed to drop.
However, once we started measuring our models on arenas, it turned out that judges preferred FP8 PTQ models over BF16 ones much less often. Architecturally, this is easy to explain: transformers are ResNet-style models, meaning each transformer block adds its share of the signal to the shared residual stream. If that signal is quantized to FP8 — and we use W8A8 quantization — error inevitably accumulates, which leads to changes in generation.
On structurally simple benchmarks like MMLU, the model is confident enough in its top-1 token that quality doesn't drop. But when long generations are evaluated with fuzzy judge-based scoring, the error accumulates, quality drifts, and the model slides down the leaderboard.
| Benchmark | bf16 | PTQ fp8 | Native fp8 |
|---|---|---|---|
| Arena A | 88.1 | 74.2 | 90.2 |
| Arena B | 85.3 | 71.8 | 83.4 |
To counter this effect, we decided to train the DPO stage in FP8, even for the 10-billion-parameter model. Since our models are architecturally similar to DeepSeek, we decided to train and quantize them following exactly the same approach as DeepSeek. The core stack consists of DeepSeek's DeepGEMM library adapted to our infrastructure, custom Triton and CUDA kernels for quantization, rowwise-to-columnwise requantization, fused (un-)permute and (un-)padding operations, and an optimized SwiGLU.
While experimenting with architectures, we arrived at an interesting conclusion: if a layer's dimensions aren't divisible by the quantization block size, we can't quantize the model properly; but we can still fine-tune any model in FP8 if we simply pad the relevant layers in BF16 up to a multiple of the block size. There was no difference in benchmarks compared to the BF16 checkpoint without padding, so the hack worked, and we gained the ability to tune the model architecture much more flexibly.
In the end, thanks to the native FP8 DPO step, we managed to recover the quality we were losing with PTQ and, in some places, even to surpass the result of BF16 training.
Local arenas
To track the quality of the DPO model, you can use automatic arena evaluations of candidates. It works like this: we compare the candidate model's generations with a baseline using LLM-as-a-Judge, and then use bootstrapping to estimate how often our model wins. To avoid position bias, the evaluation is done both ways: baseline vs. candidate and candidate vs. baseline. Both comparisons count as separate "battles" within the arena and can be dropped during bootstrapping.
The original arena-hard-auto repositories use OpenAI judges for arena evaluations: GPT-4.1, GPT-4, and so on. But using judges through the API gets fairly expensive — a single run of four target arenas costs around $180. So we decided to explore which local models we could use instead of proprietary judges.
It might seem like a simple task: take Qwen-3-30b and use it. It's fast, knows Russian reasonably well, fits on a single GPU, and has a good reputation in the community. However, after a number of experiments, it turned out that Qwen-3-30b significantly inflates metrics compared to the reference judge, GPT-4.1, and in some cases even changes the ranking of models.
| Model | gpt-4.1 | deepseek-v3.2 | gpt-oss-120b | qwen3-30b |
|---|---|---|---|---|
| Model A DPO | 60.8 | 64.5 | 57.2 | 68.0 |
| Model A SFT | 56.0 | 59.1 | 56.2 | 63.8 |
| Model B DPO | 52.0 | 55.5 | 49.5 | 62.0 |
| gpt-4o (baseline) | 50.0 | 50.0 | 50.0 | 50.0 |
| Model B SFT | 41.8 | 44.2 | 42.7 | 53.3 |
| Model C DPO | 25.8 | 28.6 | 26.1 | 42.4 |
| Model C SFT | 13.6 | 16.0 | 17.9 | 23.0 |
We also tried Kimi-K2 and DeepSeek-V3.2, but they turned out to be too large and unwieldy: bringing them up took up to four nodes (!) and 30–60 minutes of deployment. The unexpected favorite turned out to be GPT-OSS-120b. It's very fast, thanks to MXFP4 QAT it fits on a single GPU (not even a node!), and it shows excellent correlation with the baseline judge.
To speed up testing, we wrote our own orchestrator for bringing up the judge and running arenas, sped up model deployment by loading DeepGEMM from an NFS cluster, and integrated all this into our automatic metrics framework — so now we can track how arena metrics evolve right during training.
Data
In the new data version for GigaChat-3.1-Ultra, we did a lot of work on improving the training data. At Stage-1.5, we significantly expanded coverage of complex domains by working on data in math, finance, physics, engineering, biology, chemistry, and medicine, preparing a stronger cold start for the subsequent training stages.
We not only collected more data for complex domains but also tightened our quality requirements. Our strict validation system, Revizor (The Inspector), helped us do that. Among other things, we added extended checks for Markdown and LaTeX correctness and for adherence to answer formats. We also made heavy use of an LLM-judge pipeline to validate data at the SFT and DPO stages. For each dialog, the system selects judges tailored to its specifics, taking into account the task type and answer structure. This approach lets us move from generic data checks with uniform rules to more targeted validation.
For the DPO stage, we generated answers in on-policy mode, that is, based on the behavior of our preview models. Thanks to this, the DPO pairs better reflected real errors and had a stronger effect during training.
In addition, we did a lot of work on B2C scenarios, significantly expanding the code interpreter's capabilities for working with files, and improved the quality of interaction with search results and the citation mechanism. We also put special effort into improving our models' personalization by integrating user memory with the other features. The model can remember who it's talking to but also use that memory to give more accurate and relevant answers. Sometimes the answers were even too personalized: in one early version, the model remembered that the user likes dogs and added this fact to the image generation prompt, so every image featured cute little dogs — which, of course, we've fixed since.
To improve GigaChat's agentic abilities, we built a separate pipeline for generating agentic dialogs, that is, long dialogs with external function calls. The core idea of the pipeline is a move to real environments with real functions, where every call is backed by executable code and task solutions are algorithmically verifiable.
In GigaChat-3.1-Ultra, we significantly improved answer formatting and paid special attention to linguistic correctness. Together with professional editors, we created an extensive set of rules and completely overhauled the data collection process for model training according to the new standards. We wanted the model to speak its native language correctly and its answers to be aesthetically pleasing and easy to read.
Final metrics
Compared to our November release, the models have improved substantially. Math, General Reasoning, and function calling improved the most: by our measurements, we beat the non-reasoning version of Qwen3-235B-A22B and DeepSeek-V3-0324.
Thanks to the native FP8 DPO stage, our model is now both very fast and also much more vibey: on arenas it clearly beats DeepSeek-V3-0324 and has almost caught up with Qwen3-235B-A22B-Non-Thinking.

Arenas are judged by GPT-4.1 for arena-hard-logs-v3 and validator-sbs-pollux and by GPT-4 for ru-llm-arena and arena-hard-ru; baselines are GPT-4o
GigaChat Lightning Preview remains one of the best models in its size class, performing on par with Qwen-3-4B-Instruct-2507 while far outpacing it in speed thanks to the MoE architecture with 1.8B active parameters and MTP. Function calling quality deserves a special mention — the model has no equal either in its size class or among heavier models.

Compared to models from a heavier weight class, GigaChat-3-Lightning is better than GigaChat-2-Lite while being significantly faster.

But the main improvement of GigaChat-3.1-Lightning over the November release is its alignment. On our arenas, compared to models of similar size, GigaChat-3.1-Lightning is one of the best, answering on par with the GPT-4o baseline.

Judged by GPT-4.1 for arena-hard-logs-v3 and validator-sbs-pollux and by GPT-4 for ru-llm-arena and arena-hard-ru; baselines are GPT-4o
On top of that, the model has become even more efficient than the previous release, both in speed and in size. Thanks to native FP8 training, quantization comes with no quality loss compared to BF16. As a result, the model is half the size, which lets it serve twice as many users with the same amount of memory. Moreover, FP8 quantization gives the same performance boost as MTP, so using both acceleration methods increases inference speed by 40% over the BF16 model with no loss in quality:
| Configuration | Output tps | Total tps | TPOT | Diff vs BF16 |
| GigaChat-3.1-Lightning BF16 | 2,866 | 5,832 | 9.52 | +0.0% |
| GigaChat-3.1-Lightning BF16 + MTP | 3,346 | 6,810 | 8.25 | +16.7% |
| GigaChat-3.1-Lightning FP8 | 3,382 | 6,883 | 7.63 | +18.0% |
| GigaChat-3.1-Lightning FP8 + MTP | 3,958 | 8,054 | 6.92 | +38.1% |
| YandexGPT-5-Lite-8B | 3,081 | 6,281 | 7.62 | +7.5% |
All measurements were done on vllm 0.17.1rc1.dev158+g600a039f5, concurrency=32, 1×H100 80GB SXM5. Code to reproduce.
Conclusion
In the four months since the November preview, we rebuilt the entire post-training pipeline: we got rid of loops, significantly improved results on both arenas and regular benchmarks, greatly improved function calling quality, moved the DPO stage to native FP8 (which gave quality above BF16 with half the memory footprint), automated arena evaluations, and found a critical bug in SGLang. As before, the models are available on HuggingFace and GitVerse under the MIT license and across all GigaChat platforms.
But that doesn't mean we're done. There's still a lot of work and many open-source releases ahead. And if you're interested in training truly large models, come join us — there's always something to fix.
