Back to directory

KBLaM

A research method, from Microsoft, for augmenting a language model with an external knowledge base without a separate retrieval step, so the added computation grows linearly rather than quadratically.

KBLaM

KBLaM, Knowledge Base Augmented Language Models, is the official implementation of a research method for adding external knowledge to a language model. Unlike Retrieval-Augmented Generation, it does not use a separate retrieval module, and unlike in-context learning, its computational cost scales linearly with the size of the knowledge base instead of quadratically.

The repository supports Meta-Llama-3-8B-Instruct, Llama-3.2-1B-Instruct and Phi-3-mini-4k-instruct out of the box, with adapters for adding further models, and includes scripts for constructing a synthetic knowledge base and question-answer pairs, generating knowledge-base embeddings, and training the model. It is distributed as Jupyter notebooks and Python scripts under the MIT license, and its findings were published at ICLR 2025.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.