AI Search in German and Polish: How to Find Relevant Text Passages

Summary
An AI assistant answering questions about documents first needs the passage containing the answer. Embeddings turn text into number patterns so a search can find related meanings rather than only identical words. This is useful for German and Polish collections, including questions asked in a different language from the source. The article explains why finding the right document is not enough: the relevant clause and its conditions must be retrieved. Model choice and text organisation both affect the result.
Contents
An AI search first needs to find the passage that answers a question. A language model can then use that passage to write an answer. This approach is called RAG. If the search supplies the wrong section, the language model lacks the necessary evidence, even when the answer appears elsewhere in the same document.
Embedding models support this search. An embedding model turns a question or passage into a list of numbers called a vector. The search compares these lists and puts suitable passages near the top. Similar meanings should produce similar number patterns. Tests are needed to establish whether this works for German and Polish texts. Search can also compare words directly or combine both approaches.
Include language in the test
German and Polish change word forms through inflection. For example, German “Haus”, “Häuser” and “Häusern” can refer to the same concept; Polish includes “ustawa”, “ustawy” and “ustawom”. Useful search should find relevant content despite such differences. This does not imply a fixed quality loss for every English-oriented model. Training data, subject matter, text length and the actual questions also affect results.
A multilingual model is therefore a useful candidate to test, not a guarantee of success. Three tasks need separate checks: German questions with German answer passages, Polish questions with Polish passages, and, for example, Polish questions with German passages. A good result on the first task does not establish performance on the other two.

Three models with different limits
The table reports model-card specifications checked on 25 October 2026. The token count limits the input. Tokens are the text pieces processed by a model; one word may contain several tokens. Therefore, 512 tokens do not mean 512 words.
| Model | Input limit | Numbers per vector |
|---|---|---|
all-MiniLM-L6-v2 |
256 word pieces by default | 384 |
multilingual-e5-large |
512 tokens | 1024 |
bge-m3 |
Up to 8192 tokens | 1024 for the dense vector |
all-MiniLM-L6-v2 focuses on English. The other two models support many languages. A fair test must follow the required input formats: for retrieval, E5 expects query: before a question and passage: before a text, including German and Polish inputs. BGE-M3 does not need this query instruction. BGE-M3 also offers other search methods; the table describes only its single dense vector, a fixed list of numbers per text.
The passage must contain the answer
Long documents are usually split into smaller sections called chunks. For example, a section of 300 tokens does not fit MiniLM’s default input limit. Truncating the remaining text can remove the answer itself. Prefixes and special tokens also need to fit the input. The actual model configuration determines the limit.
Shorter is not always better. A single sentence may give a number without the relevant unit or condition. A very long passage may mix several topics. Useful experiments therefore compare different passage lengths, headings and overlaps. Overlap means repeating part of the text in the next passage. This can preserve context but creates additional vectors and similar results.
Count the right kind of hit
Each test question needs a marked answer passage before testing starts. For example, a question asks about a notice period. A retrieved section containing the postal address from the same contract does not count as an answer hit. Finding the right document can be a useful separate measure, but it must not be confused with finding the answer passage.
Top-5 means the five highest-ranked results. It does not mean a fixed distance in the number space. When each question has exactly one relevant passage, the test can count how often that passage appears among the first five results. When several passages are relevant, the rule must state whether one hit is enough or all pieces of evidence are needed. Different rules produce different measures.
Every model receives the same questions and document version. The record includes model version, input format, passage length, search method and hit count. Response time and memory matter alongside retrieval quality. Public tests such as MTEB or PL-MTEB help select candidates. A high overall score does not establish good results on a particular German or Polish document collection.
The comparison must fit the model
Search needs a rule for comparing lists of numbers. Cosine similarity compares direction and ignores length. A dot product also considers length. This can change the order: for a question represented by (1, 0), the vector (2, 2) has the larger dot product, while (1, 0) has the higher cosine similarity.
Normalization here means scaling a vector to length one without changing its direction. If an index uses dot products to reproduce cosine search, document and question vectors are normalized first. An index is the data structure that makes these comparisons fast. If a model specifies a different comparison method, normalization is not a universal requirement. A zero vector cannot be scaled to length one.
Whether a library already normalizes depends on the model and the actual call. The stored vectors and index setting therefore need checking. Lists from different models must not be mixed in the same comparison, even when both contain 1024 numbers: corresponding positions do not automatically have the same meaning.

Questions and answers
How much memory does a million passages require?
At 4 bytes per number, a million vectors with 384 numbers require exactly 1.536 GB; with 1024 numbers, 4.096 GB, using decimal units. Search structures, text, metadata and model weights add to this. More passages increase storage; overlaps and document boundaries affect the number of passages.
Which model is best for German and Polish?
Language support or a single ranking cannot settle that question. The deciding test is whether the model reliably finds the needed passages for the intended questions within the available resources.
What does an increase from 80 to 81 hits on 100 questions mean?
One additional hit is one percentage point. That alone does not establish a stable advantage. More questions and inspection of the actual errors help determine whether the improvement extends beyond this small sample.


