Llm Context And Microservices

Интересно, что ограничение на размер контекста и внимательность LLM-моделей подталкивают к loose coupling и микросервисам при написании приложений с их помощью. Причин, как минимум, две:

  1. Размер контекста и внимание: Загнать одно большое приложение в LLM-модель не получится, а отдельный модуль или микросервис вполне. И проблемы начинаются гораздо раньше, чем кончается место в контексте, видимо, из-за проблем с вниманием к разным частям. У разных моделей проблемы разные, но в целом они все работают лучше, если размер контекста небольшой.

  2. Сохранение контроля: При использовании LLM для генерации кода есть огромный соблазн в том, чтобы не разбираться, что оно там написало. И если сервис большой, то этот соблазн только увеличивается. Поэтому, чтобы не потерять контроль над кодом, гораздо проще держать кодовую базу каждого модуля/сервиса небольшой и контролировать их взаимодействие через строго определенные спецификации.

Да и тесты на них писать проще. А мы, похоже, движемся к моменту когда тесты станут важнее кода. ;)


It is interesting that the limitation on context size and the attentiveness of LLM models push towards loose coupling and microservices when developing applications with their help. There are at least two reasons:

  1. Context size and attention: It is not possible to fit one large application into an LLM model, but a separate module or microservice is quite feasible. Problems begin much earlier than the context space runs out, apparently due to issues with attention to different parts. Different models have different problems, but in general, they all work better if the context size is small.

  2. Maintaining control: When using LLM for code generation, there is a huge temptation not to understand what it has written. And if the service is large, this temptation only increases. Therefore, to avoid losing control over the code, it is much easier to keep the codebase of each module/service small and control their interaction through strictly defined specifications.

And writing tests for them is easier. And we seem to be moving towards a moment when tests will become more important than code. ;)