PulseAugur
EN
LIVE 10:01:39

Ollama silently truncates RAG prompts, impacting accuracy

A user discovered that Ollama, a tool for running large language models locally, was silently truncating prompts that exceeded its default context window. This issue caused retrieval-augmented generation (RAG) bots to ignore instructions and answer inaccurately, as the most critical parts of the prompt were dropped first. The problem was identified by observing the `prompt_eval_count` in the API response, which indicated the token limit was being hit. Adjusting the `num_ctx` parameter to a higher value, such as 8192, significantly improved the accuracy of grounded answers. AI

IMPACT Highlights the importance of understanding and configuring context window limits in local LLM deployments for accurate RAG.

RANK_REASON User-discovered issue with a popular local LLM runner.

Read on dev.to — LLM tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

Ollama silently truncates RAG prompts, impacting accuracy

COVERAGE [1]

  1. dev.to — LLM tag TIER_1 English(EN) · jidonglab ·

    Ollama num_ctx Default: 312 of 500 RAG Prompts Silently Truncated

    <p>My local RAG bot had one weird habit. It answered the easy questions fine, then on anything that needed real context it would confidently ignore the instructions I gave it, skip the citation format, and answer from vibes. Same model, same retriever, same prompt template. No er…