Back to feed
Dev.to
Dev.to
6/18/2026
How We Translate Entire Books with LLMs Without Losing Context

How We Translate Entire Books with LLMs Without Losing Context

Short summary

LectuLibre translates books using LLMs by splitting chapters into sentence-based chunks (1800 tokens max) rather than character breaks, preserving narrative flow. To maintain coherence across chunks without doubling token costs, they use a 5-sentence sliding context window from the previous chunk plus a one-sentence running summary fed into every prompt. This reduces token usage by ~80% compared to including full previous chunks.

  • Sentence-based chunking preserves narrative coherence vs character/paragraph splitting
  • Sliding context (5-10 previous sentences) + running summaries provide long-range coherence without doubling token costs
  • 1800-token chunks optimize API call speed and cost while maintaining translation quality

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more