Skill over Scale: The Case for Medium, Domain-Specific Models for SE
Not on the map. Why?
Abstract (arXiv)
Recent advancements in AI have sparked a trend in constructing large, generalist language models that handle a multitude of tasks, including many code-related ones. While these models are expensive to train and are often closed-source, they have enjoyed broad adoption because they tend to outperform smaller, domain-specific models of code. In this work, we argue that this is not a foregone conclusion. We show that modestly sized domain-specific models can outperform much larger ones on code labeling tasks, provided they are trained to the same standards. Concretely, we focus on StackOverflow (SO), which offers large volumes of aligned code and text data. We align established best-practices for pre-training large language models with properties of SO as a data source, especially using a large context window (2,048 tokens), coupled with a powerful toolkit (Megatron-LM) to train two models: SOBertBase (125M parameters) and SOBertLarge (762M parameters), at a budget of just 374 and 1600 each. We compare the performance of our models with a prior domain-specific model which did not adopt many of these practices (BERTOverflow), as well two general-purpose BERT models and two models in OpenAI's GPT series (GPT-3.5 and GPT-4). We study four labeling tasks: question quality prediction, closed question prediction, NER and obsoletion prediction. The final task is a new benchmark we introduce, on which we additionally compare SOBert with a fine-tuned CodeLlama and StackLlama (models with 10x more parameters than SOBertLarge). Our models consistently outperform all baselines. In contrast, BertOverflow is outperformed by generalist models in most tasks. These results demonstrate that pre-training both extensively and properly on in-domain data can yield a powerful and affordable alternative to leveraging closed-source general-purpose models. Both models are released to the public on Hugging Face.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 28 of its 45 references that are in the map. First posted on arXiv 5 Jun 2023.
Builds on
28 of 45 references.
References · 28
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,989
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
16 more
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2019How to Fine-Tune BERT for Text Classification?cited by 411
- 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
- 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 54
- 2020Comparing BERT against traditional machine learning text classificationcited by 46
- 2020Code and Named Entity Recognition in StackOverflowcited by 39
- 2022PTM4Tag: Sharpening Tag Recommendation of Stack Overflow Posts with Pre-trained Modelscited by 16
- 2019An Empirical Study of Obsolete Answers on Stack Overflowcited by 14
- 2021Fast Changeset-based Bug Localization with BERTcited by 13
- 2017Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application Securitycited by 12
- 2021On the validity of pre-trained transformers for natural language processing in the software engineering domaincited by 11
- 2018Toxic Code Snippets on Stack Overflowcited by 9
- 2022Do CoNLL-2003 Named Entity Taggers Still Work Well in 2023?cited by 9
- 2023Automated Summarization of Stack Overflow Postscited by 5
- 2017Secure Coding Practices in Java: Challenges and Vulnerabilitiescited by 4
Built on by
Not cited yet.