← All writing
NLP · 6 min read · 2 Aug 2026

Choosing a Pretrained Transformer: Size, Licence, Context

Picking a base model is rarely about leaderboard scores alone. Size, licence terms, and context length quietly decide whether your project ships or stalls.

Cover image for the article: Choosing a Pretrained Transformer: Size, Licence, Context

Why this decision matters more than the benchmark table

Every few months a new model tops a leaderboard, and it is tempting to treat that as the whole story. It is not. Choosing a pretrained transformer is a systems decision with consequences for cost, deployment, and even whether you are legally allowed to ship the thing. I have seen teams pick the highest-scoring model on a benchmark, then discover weeks later that its licence forbids commercial use, or that its context window is too short for the documents they actually need to process. The benchmark measured something real, but it did not measure the constraints that determine whether the project survives contact with production.

The three axes I keep coming back to are size, licence, and context length. They interact with each other in ways that are easy to underestimate. A larger model with a longer context window sounds strictly better until you compute the memory and latency cost of running it. A permissively licensed model sounds safer until you notice its context length forces you to chunk your data in a way that damages accuracy. None of these tradeoffs are exotic; they are just easy to skip past when a leaderboard number is sitting right there, inviting you to stop thinking.

Size: the tradeoff you can actually put a number on

Parameter count is the easiest axis to reason about quantitatively, which is exactly why it deserves careful arithmetic rather than vibes. A model with roughly seven billion parameters, held in 16-bit precision, needs on the order of fourteen gigabytes just to store the weights, before you add the memory for activations, the key-value cache, and any batching overhead. Move to a model with thirteen billion parameters and that baseline roughly doubles. This is not a subtle difference; it is the line between fitting on a single consumer GPU and needing multiple accelerators or an aggressive quantisation strategy.

The intuition worth internalising is that bigger models are not just slower, they change your entire deployment architecture. A smaller model that runs comfortably on one GPU lets you scale horizontally with simple replicas. A model that needs to be sharded across several GPUs introduces networking overhead, more complex serving code, and a much higher bar for anyone maintaining the system after you. When I evaluate size, I ask a blunt question: what is the smallest model that clears my accuracy bar on a task-representative validation set, evaluated with a leakage-aware split so the number is trustworthy? Chasing extra capacity beyond that point buys diminishing returns at a very real cost.

It is also worth remembering that size and quality are correlated but not identical. A well-trained smaller model can outperform a poorly matched larger one on a specific domain, particularly if the larger model's training data barely touched your niche. Size is a proxy for capability, not a guarantee of it, and treating it as a guarantee is how teams end up paying for compute they did not need.

gpu server rack

Licence and context length: the constraints that bite later

Licensing is the axis most likely to be ignored during prototyping and then cause a genuine crisis before launch. Some pretrained models are released under licences that explicitly restrict commercial use, cap the number of monthly active users before a separate agreement kicks in, or forbid using the model's outputs to train a competing model. These are not academic footnotes; they determine whether your product can legally exist in the form you have built it. I make it a habit to read the licence text itself, not a summary, before writing a single line of code that depends on a given model, because the summary someone posted online is not what a lawyer will read later.

Context length interacts with licence and size in a way that is easy to miss. A model advertising a context window of thirty-two thousand tokens sounds generous until you notice that its effective performance degrades well before that limit, a phenomenon sometimes called the lost-in-the-middle effect, where information placed in the centre of a long prompt is recalled less reliably than information near the start or end. If your task genuinely needs to reason over a long document, a nominally shorter context window from a model with more reliable long-range attention can beat a longer window from a model that only handles the first and last few thousand tokens well.

Concretely: suppose you are summarising legal contracts averaging twenty thousand tokens. A model with an eight-thousand-token window forces you to chunk the document, summarise each chunk, then summarise the summaries, a pipeline that compounds errors at every stage. A model with a genuine thirty-two-thousand-token window that maintains attention across that span lets you process the whole document in one pass, which is usually worth a real premium in inference cost. But you only know it is a genuine capability, rather than a marketing number, if you test it on your own documents rather than trusting the specification sheet.

Putting it together: a practical selection process

My working approach is to treat size, licence, and context length as filters applied in a specific order, because licence constraints eliminate candidates fastest and cheapest. First, list the licences that are actually compatible with how you intend to deploy, including commercial terms and any restrictions on derivative training; this removes options in minutes, not days. Second, among the survivors, estimate the memory and latency budget you can realistically operate within, which narrows the field by size before you have run a single evaluation.

Only then should you test context length and task accuracy empirically, on data that resembles what you will see in production, using a held-out split that was never touched during any prompt engineering or fine-tuning decisions. This ordering matters because it is far cheaper to disqualify a model on licence grounds than to discover the same problem after you have built an evaluation harness around it. It also keeps you honest: it is easy to fall in love with a model's benchmark performance and rationalise away a licence problem, much harder to do that once you have already ruled it out on paper.

The takeaway I would give anyone starting this process: write down your actual constraints, deployment budget, licence requirements, and the realistic length and structure of your input data, before you look at a single leaderboard. Then let those constraints do the filtering. The model that wins on a public benchmark was optimised for that benchmark's distribution, not for your contracts, your GPUs, or your legal department, and the sooner you treat the choice as an engineering decision rather than a popularity contest, the fewer surprises you will get later.

stack of legal documents on desk
← All writing See the project case studies →