Language models, retrieval, prompting, and language adaptation · Autoregressive and open-weight model families · LNG044 · Model
BLOOM
A multilingual autoregressive language model produced through the BigScience collaboration, useful as a case study in multilingual data curation, collaborative documentation, and large-model training.
In CodeSplash
Documented in the Academy only. There's no Set up button.
- Availability
- Explained here
- Code example
- Component demo, not a trained model
- Who ran it
- CodeSplash's own run
- CodeSplash's run
- The reference's example ran in Python and R here, and they agree.
- The reference's record
- Python: The chapter's authors report running it; there is no record for this entry alone. R: Reviewed but not run: R wasn't available to the reference's authors.
Purpose
A multilingual autoregressive language model produced through the BigScience collaboration, useful as a case study in multilingual data curation, collaborative documentation, and large-model training. Different sizes are consolidated within this named family.
Question / objective
How does large-scale multilingual causal pretraining distribute capability across languages?
Architecture / computational structure
A decoder-only network uses multilingual token embeddings and the reported positional attention bias. Learned decoder weights are parameters; language mix, bias slopes/configuration, model size, and decoding settings are design choices.
Assumptions
Multilingual coverage remains uneven; a shared model can reproduce corpus biases and language imbalances.
Formula / computational definition
Train a causal decoder with negative log likelihood across languages and domains. The reported model uses positional attention biases rather than simply treating positional representation choices as interchangeable with later rotary-position systems.
Parameters and notation
Learned parameters: identified in the architecture subsection. Hyperparameters, design and inference choices: Language/domain mixture, tokenizer, context length, model size, positional-bias configuration, quantization, and prompting language.
Fitting, fine-tuning, and adaptation
Fine-tune with the correct tokenizer and causal loss, using supported adapters or full updates. Balance languages in adaptation data when multilingual retention matters. Validate per-language quality and factuality, especially for small-resource languages that may be harmed by a dominant-language fine-tuning corpus.
How to use and calibrate
Report performance separately by language, domain, task, and prompt format; include throughput and memory under the actual hardware configuration. Use development data for settings and an independent test set for the final estimate. Report uncertainty across examples or seeds when the evaluation design supports it; model scores and self-assessments are not automatically calibrated probabilities of correctness.
Example application
Compare language-model continuation quality across a multilingual document archive.
Interpretation / pitfalls
Watch out
Base-model generation is not equivalent to instruction following or reliable factual answering. The code below isolates one stated component; successful execution does not validate model quality or reproduce the cited experiment.
Python and R code examples
Full implementation route: Transformers documents BLOOM causal-model loading. R can call the same Python model with reticulate. The native positional-bias example exposes a simple attention-distance penalty component without reconstructing the entire architecture.
Example scope: A causal linear distance attention-bias component associated with ALiBi-style positions.
Dependencies: Python 3 standard library; base R; shared setup above. No model downloads or external services.
Validation: Python component executed in the combined example script; R counterpart supplied but not runtime-tested here. All numbers are synthetic.
Python and R
The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.
Component demo, not a trained model — A causal linear distance attention-bias component associated with ALiBi-style positions.
Shared setup for this chapter
import math
def softmax(xs):
m = max(xs)
es = [math.exp(x-m) for x in xs]
return [e/sum(es) for e in es]
def dot(a, b):
return sum(x*y for x, y in zip(a, b))
def matvec(matrix, vector):
return [dot(row, vector) for row in matrix]
def meanvec(rows):
return [sum(row[j] for row in rows)/len(rows) for j in range(len(rows[0]))]
def sigmoid(x):
return 1/(1+math.exp(-x))
def nll(probabilities):
return -sum(math.log(p) for p in probabilities)
position, slope = 4, 0.2
bias = [-slope*(position-key) for key in range(position+1)]
print(bias)
Component demo, not a trained model — A causal linear distance attention-bias component associated with ALiBi-style positions.
Shared setup for this chapter
softmax <- function(x) {
shifted <- exp(x-max(x))
shifted/sum(shifted)
}
position <- 4L; slope <- 0.2
bias <- -slope*(position-0:position)
print(bias)
Sources
- Source 1arxiv.org
From the CodeSplash reference, entry LNG044.