Downloads · 30 days
117
39% of all-time downloads
joykirat/Qwen3-4B-TRAAC
Qwen3-4B-TRAAC is a text generation model from joykirat. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This repository hosts the TRAAC (Think Right with Adaptive, Attentive Compression) Qwen3-4B model. TRAAC is an online post-training Reinforcement Learning (RL) method designed to mitigate "under-over thinking" in Larg…
Downloads · 30 days
117
39% of all-time downloads
All-time downloads
301
Public
Parameters
4B
16.1 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
This repository hosts the TRAAC (Think Right with Adaptive, Attentive Compression) Qwen3-4B model. TRAAC is an online post-training Reinforcement Learning (RL) method designed to mitigate "under-over thinking" in Large Language Models (LLMs) by adaptively adjusting reasoning length based on task difficulty. It leverages the model’s self-attention over long reasoning trajectories to identify and prune redundant steps.
Think Right with Adaptive, Attentive Compression (TRAAC) is a novel approach that enhances LLM reasoning by balancing computational effort with task difficulty. By employing an online post-training RL method, TRAAC utilizes the model's self-attention to identify crucial reasoning steps and prune redundant ones from trajectories. It dynamically estimates problem difficulty to allocate appropriate reasoning budgets. This results in improved accuracy and significant reduction in reasoning steps across various complex tasks.
Key Highlights:
Qwen3ForCausalLM, fine-tuned Large Language Model
Given a problem, the model first generates $N$ rollouts, and the pass rate of these rollouts is used to estimate the problem's difficulty (easy, medium, or hard). Next, the generated reasoning is fed back into the model, which is asked to compute the attention score of each reasoning token from </think>. During this attention-based compression step, we remove steps with lower scores. The degree of removal is determined by the estimated difficulty: easier problems undergo more aggressive compression. Finally, we compute the correctness and length rewards using the compressed reasoning trajectory, and these rewards are used to update the policy.
The TRAAC (Qwen3-4B) model is intended for various text-generation and complex reasoning tasks, particularly where efficient and adaptive reasoning is critical. It is suitable for applications requiring balanced reasoning output lengths tailored to problem difficulty.
This model can serve as a foundation for building more efficient and robust AI agents that need to perform complex reasoning in dynamic environments. It can be fine-tuned or integrated into systems where modulating computation based on task complexity is beneficial.
The model should not be used for generating harmful, biased, or unethical content. It has been primarily trained on math and reasoning datasets, so its performance on other domains may vary, although the paper notes strong generalization.
Users should critically evaluate the model's outputs, especially for sensitive applications. Further domain-specific fine-tuning and evaluation are recommended for deployment in specialized contexts. Continuous monitoring for unintended biases and performance drifts is crucial.
For detailed instructions on installation, downloading models, running evaluations, and training, please refer to the official GitHub repository.
The GitHub repository provides scripts for:
TRAAC is an online post-training Reinforcement Learning (RL) method. The base model used for this checkpoint is Qwen3-4B.
All training data generation scripts are located in the scripts/data folder within the GitHub repository. An example script is dapo-17k.py.
Training was conducted on 3 GPUs:
scripts/train folder.Evaluation scripts for various datasets including AIME, AMC, GPQA, Overthinking Benchmark, Underthinking Benchmark, and BBEH Benchmark are located in the scripts/data folder on the GitHub repository.
TRAAC (Qwen3-4B) achieves an average absolute accuracy gain of 8.4% with a relative reduction in reasoning length of 36.8% compared to the base model, and a 7.9% accuracy gain paired with a 29.4% length drop compared to the best RL baseline across a variety of tasks (AIME, AMC, GPQA-D, BBEH). TRAAC also shows strong generalization on out-of-distribution non-math datasets like GPQA-D, BBEH, and OptimalThinkingBench.
The core of TRAAC is an online post-training RL method that uses adaptive, attentive compression. It estimates problem difficulty and prunes redundant reasoning steps based on attention scores from the model's self-attention over a long reasoning trajectory. The degree of compression is determined by the estimated difficulty, with easier problems undergoing more aggressive compression. The model's architecture, as configured in config.json, is Qwen3ForCausalLM with 36 layers and 32 attention heads.
If you find this work useful, please consider citing us:
@misc{singh2025thinkrightlearningmitigate,
title={Think Right: Learning to Mitigate Under-Over Thinking via Adaptive, Attentive Compression},
author={Joykirat Singh and Justin Chih-Yao Chen and Archiki Prasad and Elias Stengel-Eskin and Akshay Nambi and Mohit Bansal},
year={2025},
eprint={2510.01581},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2510.01581},
}