Submitted:
13 March 2026
Posted:
16 March 2026
Read the latest preprint version here
Abstract
Keywords:
1. Introduction
- We propose CoDES, a context-efficient framework for improving small language model performance through domain-specific adaptation.
- We design a training pipeline that combines parameter-efficient fine-tuning with structured conversational preprocessing and completion-only supervision.
- We introduce a weighted parameter ensembling strategy that combines multiple fine-tuned models to further narrow the performance gap with large language models.
- Through experiments on biomedical question answering tasks, we demonstrate that our framework enables small models to approach the performance of substantially larger models while requiring significantly fewer computational resources.
2. Related Work
2.1. Domain Specialization
2.2. Parameter- and Compute-efficient Adaptation
2.3. Model Ensembling and Calibration
3. Methodology
3.1. Data Selection
- 1.
- Training set: 183K questions
- 2.
- Development/Validation Set: 4K questions
- 3.
- Test Set: 6K questions
3.1.1. Domain Relevance to Medical LLM Evaluation
3.1.2. Benchmark Popularity and Reproducibility
3.1.3. Objective Evaluation via Multiple-Choice Format
3.1.4. Diverse Knowledge and Difficulty Levels
3.2. Model Selection
- 1.
- Qwen2.5-14B was chosen as a reduced-scale counterpart to Qwen-72B. Sharing a similar architectural foundation allows for a more direct examination of how parameter count influences performance under comparable conditions.
- 2.
- LLaMA3.1-8B [33] was included as a compact, open-source model with strong general-language proficiency and significantly lower computational requirements. Its smaller size makes it particularly relevant for assessing whether structured contextual input can compensate for limited capacity.
- 1.
- Performance without task-specific adaptation (i.e., zero-shot evaluation)
- 2.
- Performance after applying context-efficient fine-tuning and augmentation.
3.3. Training Method
3.4. Evaluation Metrics
Accuracy
Log Loss
- N is the total number of evaluated questions,
- c indexes the answer choices,
- is the correct label for question i,
- is the predicted probability for choice c of question i,
- is the indicator function.
4. Experiments & Results
4.1. Baseline Performance
4.2. Small Model Fine Tuning with LoRA
4.3. Ensemble of Small Models v.s. Large model
4.4. Practical Implications of the Framework
- Comparable Performance: The experimental results in Figure 2 further demonstrate that context-specific tuning can substantially improve the performance of relatively small language models and significantly narrow the gap with much larger models. For instance, the Llama3.1 8B model achieved 73.2% accuracy after contextual tuning, compared with a baseline accuracy of 63.5%. Similarly, the Qwen2.5 14B model improved from an initial baseline of 64.0% to 69.5% accuracy. When combined using the ensemble strategy within the proposed framework, the tuned small models achieved 74.8% accuracy, approaching the benchmark performance of the much larger Qwen2.5 72B model, which achieved 77.1% accuracy. These results highlight that carefully incorporating domain-relevant contextual information can significantly enhance model capability without relying solely on scaling model size.
- Lower Cost and Resource Requirements: The framework enables high performance while operating with substantially smaller models. Training and inference with small language models require significantly fewer computational resources due to reduced parameter counts. Table 4 shows that the Qwen2.5-72B model consumes approximately 0.2 kWh of energy to analyze 10k multiple-choice questions, which is about seven times more than the 8B model and four times more than the 14B model. Even when using an ensemble of small models, the large model still consumes approximately 2.5 times more energy. This highlights the potential of the proposed framework to reduce operational costs and energy consumption.
- Faster Inference Performance: Smaller models also enable faster response times. Large models require substantially more matrix multiplications and memory transfers during inference, leading to higher latency. By leveraging multiple tuned small models within the proposed framework, systems can maintain strong predictive performance while achieving faster inference speeds, which is particularly beneficial for real-time or large-scale applications.
- Flexible Domain Customization: The framework facilitates efficient adaptation of models to specialized domains. Through experiments on the MedMCQA dataset, we demonstrate that small models can be effectively tailored to domain-specific tasks through contextual fine-tuning. This modular approach allows organizations to customize models for specific knowledge domains without the need to train or deploy extremely large models.
5. Conclusions
References
- Tariq Shahzad, Tehseen Mazhar, Muhammad Usman Tariq, Wasim Ahmad, Khmaies Ouahada, and Habib Hamam. A comprehensive review of large language models: Issues and solutions in learning environments. Discov. Sustain., 6(1), January 2025.
- Maximilian Dauner and Gudrun Socher. Energy costs of communicating with ai. Frontiers in Communication, Volume 10 - 2025, 2025.
- Xinjin Li, Yu Ma, Yangchen Huang, Xingqi Wang, Yuzhen Lin, and Chenxi Zhang. Synergized data efficiency and compression (sec) optimization for large language models. In 2024 4th International Conference on Electronic Information Engineering and Computer Science (EIECS), pages 586–591, 2024. [CrossRef]
- Chao Wu, Baoheng Li, Mingchen Gao, and Zhenyi Wang. From efficiency to adaptivity: A deeper look at adaptive reasoning in large language models, 2025. [CrossRef]
- Peter Belcak, Greg Heinrich, Shizhe Diao, Yonggan Fu, Xin Dong, Saurav Muralidharan, Yingyan Celine Lin, and Pavlo Molchanov. Small language models are the future of agentic ai, 2025.
- Fali Wang, Zhiwei Zhang, Xianren Zhang, Zongyu Wu, TzuHao Mo, Qiuhao Lu, Wanjing Wang, Rui Li, Junjie Xu, Xianfeng Tang, Qi He, Yao Ma, Ming Huang, and Suhang Wang. A comprehensive survey of small language models in the era of large language models: Techniques, enhancements, applications, collaboration with llms, and trustworthiness. ACM Trans. Intell. Syst. Technol., 16(6), November 2025.
- Ismail Lamaakal, Yassine Maleh, Khalid El Makkaoui, Ibrahim Ouahbi, Paweł Pławiak, Osama Alfarraj, May Almousa, and Ahmed A Abd El-Latif. Tiny language models for automation and control: Overview, potential applications, and future research directions. Sensors (Basel), 25(5):1318, February 2025.
- Jiantong Jiang, Peiyu Yang, Rui Zhang, and Feng Liu. Towards efficient large language model serving: A survey on system-aware kv cache optimization. Authorea Preprints, 2025. [CrossRef]
- Hyunjae Kim, Hyeon Hwang, Jiwoo Lee, Sihyeon Park, Dain Kim, Taewhoo Lee, Chanwoong Yoon, Jiwoong Sohn, Jungwoo Park, Olga Reykhart, Thomas Fetherston, Donghee Choi, Soo Heon Kwak, Qingyu Chen, and Jaewoo Kang. Small language models learn enhanced reasoning skills from medical textbooks. NPJ Digit. Med., 8(1):240, May 2025.
- Lexin Zhou, Wout Schellaert, Fernando Martínez-Plumed, Yael Moros-Daval, Cèsar Ferri, and José Hernández-Orallo. Larger and more instructable language models become less reliable. Nature, 634(8032):61–68, 2024.
- Martin Juan José Bucher and Marco Martini. Fine-tuned’small’llms (still) significantly outperform zero-shot generative ai models in text classification. arXiv preprint arXiv:2406.08660, 2024.
- Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
- Jinming Xing, Dongwen Luo, Chang Xue, and Ruilin Xing. Comparative analysis of pooling mechanisms in llms: A sentiment analysis perspective, 2025. [CrossRef]
- Chaojun Xiao, Jie Cai, Weilin Zhao, Biyuan Lin, Guoyang Zeng, Jie Zhou, Zhi Zheng, Xu Han, Zhiyuan Liu, and Maosong Sun. Densing law of LLMs. Nature Machine Intelligence, 7(11):1823–1833, November 2025.
- Yisu Wang, Ruilong Wu, Xinjiao Li, and Dirk Kutscher. Pactrain: Pruning and adaptive sparse gradient compression for efficient collective communication in distributed deep learning. In 2025 62nd ACM/IEEE Design Automation Conference (DAC), pages 1–7, 2025. [CrossRef]
- Yixiao Zhou, Ziyu Zhao, Dongzhou Cheng, Zhiliang Wu, Jie Gui, Yi Yang, Fei Wu, Yu Cheng, and Hehe Fan. Dropping experts, recombining neurons: Retraining-free pruning for sparse mixture-of-experts llms. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 15169–15186, 2025. [CrossRef]
- Shuang Zeng, Dekang Qi, Xinyuan Chang, Feng Xiong, Shichao Xie, Xiaolong Wu, Shiyi Liang, Mu Xu, Xing Wei, and Ning Guo. Janusvln: Decoupling semantics and spatiality with dual implicit memory for vision-language navigation, 2026. [CrossRef]
- Zhangquan Chen, Manyuan Zhang, Xinlei Yu, Xufang Luo, Mingze Sun, Zihao Pan, Yan Feng, Peng Pei, Xunliang Cai, and Ruqi Huang. Think with 3d: Geometric imagination grounded spatial reasoning from limited views, 2025. [CrossRef]
- Ruihan Luo, Xuanjing Chen, and Ziyang Ding. Sequda-rec: Sequential user behavior enhanced recommendation via global unsupervised data augmentation for personalized content marketing. arXiv preprint arXiv:2509.17361, 2025. [CrossRef]
- Jiahao Tian, Zhenkai Wang, Jinman Zhao, and Zhicheng Ding. Mmrec: Llm based multi-modal recommender system. In 2024 19th International Workshop on Semantic and Social Media Adaptation & Personalization (SMAP), pages 105–110. IEEE, 2024. [CrossRef]
- Ankit Pal, Logesh Kumar Umapathi, and Malaikannan Sankarasubbu. Medmcqa : A large-scale multi-subject multi-choice dataset for medical domain question answering, 2022.
- Dingyuan Liu, Qiannan Shen, and Jiaci Liu. The health-wealth gradient in labor markets: Integrating health, insurance, and social metrics to predict employment density. Computation, 14(1):22, 2026. [CrossRef]
- Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models, 2021.
- Tianyi Zhang, Kishore Kasichainula, Yaoxin Zhuo, Baoxin Li, Jae-Sun Seo, and Yu Cao. Transformer-based selective super-resolution for efficient image refinement. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 7305–7313, 2024. [CrossRef]
- Qiannan Shen and Jing Zhang. Mftformer: Meteorological-frequency-temporal transformer with block-aligned fusion for traffic flow prediction. Research Square, 2026. Preprint, . [CrossRef]
- Qiang Wang, Feng Liu, Bo Zhang, Jiaci Liu, Fang Xu, and Yifan Wang. Siamctca: Cross-temporal correlation aggregation siamese network for uav tracking. Drones, 9(4):294, 2025. [CrossRef]
- Dandan Wang and Shiqing Zhang. Large language models in medical and healthcare fields: Applications, advances, and challenges. Artificial Intelligence Review, 2024.
- Ziheng Chen, Chuqing Zhao, Mengyu Zhao, Qishi Zhan, Yushen Dong, Siqiao Zhao, Sijing Yu, Chenxi Yao, Yongyu Xie, Zhikang Dong, Qianyi Sun, Yunbo Liu, Cheng-Han Yu, Haochen Yang, and Guansu Wang. Rethinking subjective trust in llm: Actualizing tangibility from uncertainty. December 2025. [CrossRef]
- Jinhua Yang, Ting Liu, Yiming Taclis Luo, Tianyue Niu, Patrick Cheong-Iao Pang, Ao Xiang, and Qin Yang. Exploring the application boundaries of llms in mental health: A systematic scoping review. Frontiers in Psychology, 16:1715306, 2025. [CrossRef]
- Augustin Toma, Patrick R. Lawler, Jimmy Ba, Rahul G. Krishnan, Barry B. Rubin, and Bo Wang. Clinical camel: An open expert-level medical language model with dialogue-based knowledge encoding. arXiv preprint arXiv:2305.12031, 2023.
- Tasnimul Hassan, Md Faisal Karim, Haziq Jeelani, Elham Behnam, Robert Green, and Fayeq Jeelani Syed. Optimizing medical question-answering systems: A comparative study of fine-tuned and zero-shot large language models with rag framework. arXiv preprint arXiv:2512.05863, 2025.
- An Yang, Baosong Yang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Zhou, Chengpeng Li, Chengyuan Li, Dayiheng Liu, Fei Huang, Guanting Dong, Haoran Wei, Huan Lin, Jialong Tang, Jialin Wang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Ma, Jianxin Yang, Jin Xu, Jingren Zhou, Jinze Bai, Jinzheng He, Junyang Lin, Kai Dang, Keming Lu, Keqin Chen, Kexin Yang, Mei Li, Mingfeng Xue, Na Ni, Pei Zhang, Peng Wang, Ru Peng, Rui Men, Ruize Gao, Runji Lin, Shijie Wang, Shuai Bai, Sinan Tan, Tianhang Zhu, Tianhao Li, Tianyu Liu, Wenbin Ge, Xiaodong Deng, Xiaohuan Zhou, Xingzhang Ren, Xinyu Zhang, Xipin Wei, Xuancheng Ren, Xuejing Liu, Yang Fan, Yang Yao, Yichang Zhang, Yu Wan, Yunfei Chu, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, Zhifang Guo, and Zhihao Fan. Qwen2 technical report, 2024.
- Meta AI. Introducing llama 3.1: Open source ai models. https://ai.meta.com/blog/meta-llama-3-1/, 2024. Accessed: 2026-03-07.
- Younes Belkada and Hugging Face Contributors. Trl: Transformer reinforcement learning library. https://huggingface.co/docs/trl/sft_trainer, 2023. Accessed: 2026.
- Enneng Yang, Li Shen, Guibing Guo, Xingwei Wang, Xiaochun Cao, Jie Zhang, and Dacheng Tao. Model merging in llms, mllms, and beyond: Methods, theories, applications and opportunities, 2025.
- Jiahao Tian and Zhenkai Wang. Dlrrec: Denoising latent representations via multi-modal knowledge fusion in deep recommender systems. arXiv preprint arXiv:2512.00596, 2025. [CrossRef]


| Baseline Model | Sample Size | Accuracy |
|---|---|---|
| Qwen2.5-72B | 10k | 77.1% |
| Llama3.1-8B | 10k | 63.5% |
| Qwen2.5-14B | 10k | 64.0% |
| Model | Learning Rate | Epoch | Accuracy | Log Loss |
|---|---|---|---|---|
| Llama3.1-8B1 | 1 | 72.5% | 1.09 | |
| Llama3.1-8B2 | 1 | 70.6% | 1.10 | |
| Llama3.1-8B3 | 2 | 73.2% | 1.09 | |
| Llama3.1-8B4 | 1 | 63.6% | 1.19 | |
| Llama3.1-8B5 | 2 | 68.5% | 1.14 | |
| Qwen2.5-14B1 | 1 | 63.7% | 1.19 | |
| Qwen2.5-14B2 | 2 | 69.5% | 1.12 | |
| Qwen2.5-14B3 | 1 | 63.5% | 1.19 |
| Llama Weight | Qwen Weight | Accuracy | Log Loss |
|---|---|---|---|
| 0.80 | 0.20 | 73.4% | 0.70 |
| 0.70 | 0.30 | 74.1% | 0.68 |
| 0.65 | 0.35 | 74.8% | 0.66 |
| 0.60 | 0.40 | 74.3% | 0.67 |
| 0.50 | 0.50 | 73.8% | 0.68 |
| Model | Energy Consumption (kWh) |
|---|---|
| Qwen2.5-72B | 0.20 |
| Llama3.1-8B | 0.03 |
| Qwen2.5-14B | 0.05 |
| Qwen2.5-14B + Llama3.1-8B | 0.08 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).