MosaicBERT

MosaicBERT-Base-SeqLen-2048

by Databricks Data + AI Platform · Available open-weight checkpoint; legacy research model

MosaicBERT-Base-SeqLen-2048 is a 137-million-parameter, open-weight BERT encoder trained on English C4 with a 2,048-token sequence length. It is designed for masked-language modeling, text representations, downstream NLP fine-tuning, and efficient encoder research, not conversational generation or hosted API use.

Text Reasoning Coding
MosaicBERT-Base-SeqLen-2048 is a research-oriented BERT encoder released by MosaicML, now part of Databricks Mosaic Research. It was trained on English C4 with a masked-language-modeling objective and supports sequences up to 2,048 tokens. The checkpoint is designed for extracting and fine-tuning text representations, not for generating chat responses or completing arbitrary text like an autoregressive language model.
Outputs

What MosaicBERT-Base-SeqLen-2048 can produce

Text
Inputs

What it can understand

Text
Capabilities

Support features

Fine-tuning
Model profile

Performance characteristics

2/10 Reasoning
2/10 Coding
9/10 Speed
9/10 Cost efficiency
Specifications

Technical details

Family MosaicBERT
Type General Purpose
Context window 2K tokens
Max output tokens tokens
Release date April 2023
Status Available open-weight checkpoint; legacy research model
Knowledge cutoff notes

No authoritative knowledge-cutoff date is published for this pretrained masked-language encoder. Its training data is described as the English C4 dataset, but the model documentation does not provide a conventional knowledge-cutoff date.

Model notes

The canonical Hugging Face identifier is mosaicml/mosaic-bert-base-seqlen-2048. The model is a bidirectional encoder trained with masked language modeling rather than an autoregressive text generator. It uses the standard bert-base-uncased tokenizer and was trained on English C4. The checkpoint was trained at a maximum sequence length of 2048 tokens using ALiBi, which can support sequence-length extrapolation when the configuration is adjusted, although longer-context use is not equivalent to additional pretraining at that length. Loading generally requires trust_remote_code=True because of custom MosaicBERT and FlashAttention-related code. MosaicBERT-Base has approximately 137 million parameters and is licensed under Apache 2.0. Reasoning, coding, speed, and cost scores are editorial estimates based on the model's encoder architecture, open-weight availability, and stated training-efficiency goals rather than official benchmark fields.

COST

Pricing

Input No hosted API pricing; downloadable Apache 2.0 weights
Output No hosted API pricing; downloadable Apache 2.0 weights
Model guide

MosaicBERT-Base-SeqLen-2048: An Open-Weight BERT Encoder for 2,048-Token NLP

MosaicBERT-Base-SeqLen-2048 is an open-weight, 137-million-parameter BERT-style encoder trained with masked language modeling on English C4. Its 2,048-token training length, ALiBi attention, FlashAttention, dynamic unpadding, gated linear units, and low-precision LayerNorm make it suited to long-context text representation and efficient NLP fine-tuning rather than conversational text generation.

MosaicBERT-Base-SeqLen-2048 is an open-weight BERT-style encoder for language understanding tasks. The model has approximately 137 million parameters and was trained on English C4 using masked language modeling, an objective in which portions of an input are hidden and the model learns to infer them from surrounding context. This makes the checkpoint useful for learning representations of text, classifying documents, adapting an encoder to a downstream task, or experimenting with efficient BERT training techniques.

The model was released by MosaicML, which is now part of Databricks Mosaic Research. It is best understood as a research and fine-tuning checkpoint in Databricks’ open model catalog rather than as a current hosted conversational model. Its defining distinction is the 2,048-token sequence length used during training, combined with architectural changes intended to improve training efficiency.

What is MosaicBERT-Base-SeqLen-2048?

MosaicBERT-Base-SeqLen-2048 is a bidirectional encoder. Unlike an autoregressive generator, which predicts the next token from earlier tokens, a bidirectional encoder can use information from both sides of a token when building a representation of the input. This design is useful when the task requires understanding or comparing an existing piece of text.

The checkpoint uses the standard bert-base-uncased tokenizer and was trained on English C4. The “SeqLen-2048” name indicates that the model was trained with a maximum sequence length of 2,048 tokens, substantially longer than the 512-token sequence length associated with the original BERT-base configuration. The supplied model documentation identifies the Hugging Face checkpoint as mosaicml/mosaic-bert-base-seqlen-2048.

Masked-language-model pretraining does not make this a general-purpose text-generation model. Its outputs are better suited to representations, masked-token predictions, and task-specific heads than to producing a coherent multi-paragraph answer. Applications that need chat, instruction following, code generation, or open-ended completion should use a generative model instead.

Architecture and training approach

MosaicBERT incorporates several techniques from MosaicML’s efficiency-focused BERT work:

  • ALiBi: attention biases provide information about token distance without relying on the usual learned positional-embedding scheme. The configuration can support sequence-length extrapolation when adjusted, although using longer inputs is not the same as pretraining the model on those longer sequences.
  • FlashAttention: an attention implementation intended to reduce memory traffic and improve training efficiency.
  • Dynamic unpadding: removes padding tokens from computation where possible, reducing wasted work in batches containing inputs of different lengths.
  • Gated linear units: a feed-forward design used in the model’s transformer blocks.
  • Low-precision LayerNorm: a training-efficiency technique included in the MosaicBERT recipe.

These features are primarily relevant to training and inference efficiency for an encoder workload. They do not turn the model into a larger or more capable reasoning system. The model remains a relatively compact BERT-family checkpoint with a focused masked-language-understanding objective.

Context, inputs, and outputs

SpecificationDetails
Model familyMosaicBERT
ParametersApproximately 137 million
Maximum trained sequence length2,048 tokens
Tokenizerbert-base-uncased
Training dataEnglish C4
Primary objectiveMasked language modeling
Input modalityText
Output modalityText-derived representations or masked-language-model predictions
LicenseApache 2.0

The verified sequence limit is 2,048 tokens for the released training configuration. ALiBi may make experimentation with longer sequences possible after configuration changes, but that should be treated as an engineering experiment rather than a guaranteed supported context length. Longer inputs also do not benefit from additional pretraining at those lengths unless the user performs further training.

This model has no documented maximum output-token setting in the sense used for chat APIs. It is not an autoregressive output generator, so the relevant output depends on the task head: token-level predictions for masked language modeling, pooled or per-token hidden representations, or predictions from a downstream fine-tuned classifier.

Strengths and practical capabilities

The main practical strength of MosaicBERT-Base-SeqLen-2048 is its combination of a compact BERT architecture and a longer trained sequence length. A 2,048-token input can cover substantially more of a document, passage, or conversation excerpt than a conventional 512-token BERT setup. That can reduce the need to split text into small fragments for tasks such as document classification or long-passage representation.

Its open-weight format is another advantage. Users can download the checkpoint, inspect the implementation, run it on their own infrastructure, and fine-tune it without paying for a hosted inference API. The Apache 2.0 license is permissive, subject to the license’s terms. The checkpoint is also suitable for studying the effects of FlashAttention, ALiBi, unpadding, and related efficiency techniques in an encoder model.

Fine-tuning is supported in the practical sense that the weights and training implementation are available for downstream NLP work. Typical examples include sentiment or topic classification, document categorization, token classification, retrieval-oriented representations, and other tasks that attach a task-specific head to an encoder. The supplied research does not provide a universal benchmark score, so task quality should be evaluated on the user’s own data rather than inferred from the architecture alone.

Limitations and unsupported uses

MosaicBERT-Base-SeqLen-2048 is not an instruction-following or conversational model. It does not provide a managed chat endpoint, web search, tool or function calling, streaming responses, structured-output mode, or multimodal processing. Its inputs and outputs are text-related, but “text output” here means model predictions or representations rather than free-form answers.

There is no hosted API price listed for this checkpoint. The practical cost model is therefore the cost of downloading, storing, and running the weights and associated software on user-controlled infrastructure. That can be attractive for repeated batch processing, privacy-sensitive workloads, or experimentation, but it also places operational responsibilities on the user. The supplied documentation notes that loading generally requires trust_remote_code=True because the checkpoint uses custom MosaicBERT and FlashAttention-related code. Users should review and trust the repository code before enabling that option.

The model is also not a substitute for a modern generative language model when the task requires reasoning through instructions, writing an answer, generating code, or maintaining a dialogue. Its editorial reasoning and coding scores are low because the encoder and pretraining objective are not designed for those functions. Those scores are evaluations based on the model’s architecture and intended use, not provider-published benchmark results.

Speed, cost, and capability trade-offs

At approximately 137 million parameters, the checkpoint is much smaller than many current generative language models. Its encoder-only structure and efficiency-oriented training recipe can make it a practical choice for high-volume text representation or classification, particularly when the application does not need generated prose. In the supplied editorial assessment, it receives high speed and cost ratings because it is compact and available as downloadable weights rather than a metered hosted service.

Those advantages come with a narrower capability envelope. A small encoder can be faster and cheaper for fixed-text analysis than a generative model, but it cannot directly replace a generative model for summarization, interactive assistance, code completion, or instruction execution. The most appropriate comparison is therefore not “which model gives the best answer?” but “does this workload need an encoder representation or a generated response?”

When to choose MosaicBERT-Base-SeqLen-2048

Choose this checkpoint when you need an open-weight English text encoder and the 2,048-token trained sequence length is useful. It is a reasonable candidate for:

  • fine-tuning a BERT-style model for document or passage classification;
  • building token-level NLP systems that need contextual representations;
  • processing longer text segments without immediately reducing them to 512 tokens;
  • researching efficient transformer training and inference techniques;
  • running repeatable, self-hosted batch workloads without hosted API charges; and
  • using Apache 2.0 model weights in projects whose requirements are compatible with that license.

Choose another type of model when you need natural-language generation, instruction following, conversational interaction, code generation, multimodal input, tool use, or a managed production API. A conventional shorter-context encoder may also be easier to integrate if 2,048-token inputs are unnecessary, while a newer or larger encoder may be more appropriate if validation shows that this checkpoint’s task accuracy is insufficient. The supplied research does not identify a specific successor or provide comparative benchmark results, so such a choice should be made through task-specific testing.

Availability and pricing

MosaicBERT-Base-SeqLen-2048 is available as an open-weight Hugging Face checkpoint under the identifier mosaicml/mosaic-bert-base-seqlen-2048. The research describes it as an available but legacy research model associated with MosaicML and Databricks Mosaic Research. The weights are downloadable under the Apache 2.0 license.

No hosted API pricing is documented for the checkpoint. There is consequently no verified per-token input price, output price, monthly plan, or maximum output-token allowance to report. Deployment costs depend on the user’s hardware, cloud infrastructure, storage, and operational setup. This distinction matters: “no hosted API pricing” does not mean inference is free, only that the model is supplied as downloadable weights rather than as a priced managed endpoint.

Bottom line

MosaicBERT-Base-SeqLen-2048 is a focused, efficient BERT encoder for users who need open-weight text understanding rather than a general-purpose chatbot. Its most useful distinguishing feature is the 2,048-token training configuration, supported by ALiBi and other efficiency-oriented changes. It can be a strong starting point for self-hosted NLP fine-tuning and long-passage representation experiments, but its encoder architecture, lack of hosted API features, and absence of generative instruction-following capabilities make it unsuitable for conversational or open-ended generation workloads.


Answers to Frequently Asked Questions

Where can I use MosaicBERT-Base-SeqLen-2048, and how much does it cost?
The checkpoint is available on Hugging Face as mosaicml/mosaic-bert-base-seqlen-2048 under the Apache 2.0 license. No hosted API pricing is documented; users download and run the weights on their own infrastructure, paying for hardware, cloud resources, storage, and operations.
Can MosaicBERT-Base-SeqLen-2048 generate text or answer questions like a chatbot?
No. MosaicBERT-Base-SeqLen-2048 is an encoder trained for masked language modeling, not an autoregressive generative model. It produces text representations, masked-token predictions, or downstream task outputs, so chat, instruction following, open-ended writing, and code generation require a generative model instead.
What is MosaicBERT-Base-SeqLen-2048?
MosaicBERT-Base-SeqLen-2048 is an open-weight, bidirectional BERT-style encoder with approximately 137 million parameters. It was trained on English C4 using masked language modeling and is designed for text representations, classification, token-level NLP tasks, and fine-tuning.
What is the context length of MosaicBERT-Base-SeqLen-2048?
The released training configuration supports sequences up to 2,048 tokens, which is longer than the 512-token limit associated with the original BERT-base configuration. ALiBi may allow experimentation with longer inputs, but those lengths are not guaranteed to be supported or pretrained.


Sources 4
AI Provider

About Databricks Data + AI Platform