Manuscript Offprint

arXiv:2611.03756

Language Models Can Benefit from Domain-Specific Inductive Biases

Damien Teney, Liangze Jiang, Zachary Shinnick, Hemanth Saratchandran, Simon Lucey

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Language models are typically trained with a single choice of architecture on diverse domains and data sources. Modern transformers have been extensively refined for such general-purpose learning, but are they equally effective across different subsets of the pretraining data?

Methods. We investigate this question by training small language models from scratch on representative subsets of pretraining data such as web text, code, and mathematics. We introduce variants of transformers in which standard activation functions are replaced with learned splines tuned on specific datasets, providing a simple way to modify their inductive biases. Using a mix-and-match of architectures and datasets, we evaluate cross-domain transfer, i.e. how well does an architecture tuned for one domain perform on data from another?

Findings. The tuned transformer variants improve training efficiency or generalization on all seven of our tested datasets, but the gains are often domain-specific. For example, architectures tuned on a natural language dataset such as FINEWEB perform well on TINYSTORIES, whereas those tuned on mathematics perform poorly on natural language. We identify several mechanisms underlying these improvements, including wider loss basins and more abundant “lottery tickets”.

Implications. Our results show that different subsets of pretraining data can benefit from different learning mechanisms, highlighting a limitation of the prevailing trend towards a small set of general-purpose architectures and optimizers. This points to an opportunity to improve data efficiency by developing domain-specific learning strategies that retain the ability to train general-purpose models.

1 Introduction

Machine learning over the last decade has converged towards a small set of widely used architectures and algorithms (Wilson, 2025). In particular, transformers have proved remarkably effective across domains and modalities (Xu et al., 2023), enabling language models to learn from vast mixtures of web text, mathematics, and code. This diversity is key to their capabilities (Longpre et al., 2024) and suggests that transformers possess broadly applicable inductive biases (Goldblum et al., 2023). Yet classical results like the no-free-lunch theorem tell us a learning method cannot be optimal across all tasks (Wolpert, 1996). How much performance is therefore left on the table by using a common architecture on such diverse data, compared to inductive biases tailored to individual subsets?

This paper argues that the monolithic design of language models may be suboptimal and shows that domain-specific learning mechanisms can improve data efficiency and generalization.

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Position Paper Track.

Figure

Figure 1: Our experimental setup quantifies the compatibility of inductive biases across subsets of data. We specialize a transformer variant for a source domain D1D_1 (left) by replacing nonlinearities with parameterized splines, pre-trained in a warm-up phase. We then reuse these frozen components to train a model on a target dataset D2D_2 (right). Only very few parameters are transferred.

Methods. We investigate the proposition empirically using variants of transformers that we tune for individual domains.¹ We then train and evaluate these variants on other domains (Figure 1). To obtain these variants of transformers, we build on the observation that neural inductive biases are strongly determined by the choice of activation function (Teney et al., 2024). Prior work shows that standard choices like GeLUs can be replaced with splines, which can be learned and optimized for specific data (Hu et al., 2025a; Teney et al., 2025). We use this approach as a tool to obtain domain-specialized nonlinearities.² We then use them as frozen components to train new models on various datasets (Section 3). This allows studying the cross-domain transfer of architectural inductive biases without deviating far from standard transformers.

Datasets. We consider subsets of data representative of standard pretraining mixtures, covering natural language (FINEWEB, Penedo et al. 2024, ENWIK8, Mahoney 2006, TINYSTORIES, Eldan & Li 2023, SHAKESPEARE Karpathy 2015), code (CODESEARCHNET-JAVA and PYTHON, Husel et al. 2019), and informal mathematics (DEEPMIND-MATH, comprising 56 types of high-school-level questions and answers, Saxton et al. 2019). We evaluate standard transformers against specialized variants using validation loss/accuracy on fixed token budgets, and examine transfer across datasets.

Our first finding is that standard transformers are rarely optimal for individual domains. On every dataset, our variants improve training efficiency or final performance. Second, specialized architectures often transfer well across related datasets, but weakly or not at all across disparate domains such as natural language and mathematics. These results suggest that different domains can benefit from different inductive biases, pointing to the potential for future methods that combine specialized learning mechanisms within general-purpose models.

We also investigate the mechanisms of these improvements. Specialized architectures make effective solutions more accessible by gradient descent. Training converges faster and is less dependent on learning rate decay, suggesting wider loss basins. They also contain more circuits relevant to the target task at initialization, in line with the lottery ticket hypothesis (Frankle & Carbin, 2019).

Broader implications. Despite continued scaling, state-of-the-art models remain data-hungry and struggle with systematic generalization (e.g. compositionality, multi-hop reasoning, length generalization). Our results point to an overlooked opportunity to address these limitations. They show that even fine-grained data subsets can benefit from different inductive biases, and minor modifications to the transformer architecture can substantially affect learnability. Our domain-specific models serve only as a tool, and the challenge is now to leverage a greater diversity of inductive biases with general-purpose models, potentially through interactions among specialized learning mechanisms, much as human reasoning draws on interactions among specialized networks (Hampshire et al., 2011). We outline research directions towards this goal in Section 6.

Limitations. Our study is large (> 6,000 models) but with small models (40–120M parameters). Prior work by Teney et al. (2026) shows however that learned activation functions can improve systematic generalization in ways that do not emerge with more data or parameters. The question remains whether the benefits on language tasks persist with larger models. Our evaluations also focus on perplexity and not downstream performance. See Appendix A for an FAQ.

¹We use domains to refer to subsets of pretraining data, which can differ in semantic contents, data sources, tokenization, etc. ²We use activation functions and nonlinearities interchangeably. The former usually refer to nonlinearities in MLPs, while we also consider nonlinearities in attention layers.

References (80)