In the context of the BM25 algorithm and sparse retrieval, stop words are typically removed before indexing to reduce the size of the inverted index and improve query performance. Because these words appear in nearly every document, their term frequency and inverse document frequency provide negligible signal for distinguishing relevant documents from non-relevant ones, making them statistical noise in a bag-of-words retrieval model.
Glossary
Stop Words

What is Stop Words?
Stop words are high-frequency function words, such as 'the,' 'is,' and 'at,' that are filtered out during text preprocessing because they carry minimal discriminative semantic value for information retrieval tasks.
Modern analyzer pipelines, such as those in Elasticsearch BM25 and Lucene, use a stop filter to discard tokens from a predefined list. However, in phrase matching scenarios, stop words can be critical for accurate results, requiring search engines to preserve positional information even when the term is ignored for scoring, preventing false positives in queries like 'flights to London' versus 'flights from London.'
Core Characteristics of Stop Words
Stop words are high-frequency function words that carry minimal discriminative semantic value and are typically filtered out during text indexing and query processing to improve efficiency and relevance.
Functional vs. Content Words
Stop words are almost exclusively function words—the grammatical glue of a language—rather than content words that carry the core meaning.
- Function words (stopped): determiners (the, a), prepositions (in, of), conjunctions (and, but), auxiliary verbs (is, was)
- Content words (kept): nouns, main verbs, adjectives, adverbs
This distinction is critical because removing function words transforms a sentence like 'The quick brown fox jumps over the lazy dog' into the sparse representation 'quick brown fox jumps lazy dog', preserving the semantic core while drastically reducing the index size.
Inverse Document Frequency Characteristics
Stop words exhibit an extremely low IDF score, which mathematically quantifies their lack of discriminative power.
- A word like 'the' appears in nearly 100% of documents, yielding an IDF approaching log(1) = 0
- In the BM25 and TF-IDF frameworks, this zero or near-zero weight means stop words contribute nothing to the relevance score
- Filtering them at the analyzer stage is more efficient than computing and multiplying by a zero weight during query time
The IDF property is what formally justifies their removal: they are terms that fail to help distinguish one document from another.
Language-Specific Stop Lists
Stop word lists are language-dependent and must be curated for each linguistic context. A universal list does not exist.
- English: 'the', 'is', 'at', 'which', 'on' (typically 100-300 words)
- Mandarin Chinese: particles like 的 (de), 了 (le), 是 (shì)
- Arabic: common prepositions and conjunctions, complicated by agglutinative morphology
Modern search engines like Elasticsearch provide built-in stop filters for dozens of languages. Using the wrong language's stop list will either fail to remove noise or, worse, strip meaningful tokens from the text.
Phrase Query Preservation
Stop word removal creates a significant challenge for phrase matching and exact-quote searches, where function words define the grammatical structure.
- The query "to be or not to be" consists entirely of stop words and would be reduced to an empty token stream
- The query "flights to London" loses the directional preposition, potentially matching "flights from London"
- Solution: Search engines often maintain a positional index that records token positions before stop word removal, or they skip stop word filtering entirely for phrase queries
This is why modern analyzers may use a stop filter during indexing but disable it during query-time analysis for quoted phrases.
Domain-Specific Exceptions
In specialized domains, common words that would normally be stopped can carry critical semantic weight and must be preserved.
- Healthcare: 'IT' (Information Technology) vs. 'it' (pronoun) — case-sensitive preservation required
- Music: The band 'The Who' — stopping 'the' and 'who' destroys the entity
- Legal: 'will' as a testamentary document vs. auxiliary verb
- Technology: 'A/B testing' — the forward slash and single letters are essential
Domain adaptation of stop lists is a necessary step in building a production search system. A generic list applied blindly will cause entity recognition failures.
Impact on Index Compression
Filtering stop words provides substantial storage and performance benefits by reducing the inverted index size.
- In a typical English text corpus, the 10 most frequent words account for 25-30% of all term occurrences
- Removing these from the postings lists eliminates millions of entries that would never contribute to a relevance score
- This reduces disk I/O during query evaluation and shrinks the memory footprint of cached index segments
- However, with modern compression techniques like Frame of Reference (FOR) and prefix encoding, the marginal gain from aggressive stop word removal has diminished compared to early search engines
Frequently Asked Questions
Clear, technical answers to the most common questions about stop word filtering, its impact on search relevance, and its evolving role in modern information retrieval systems.
Stop words are high-frequency function words—such as 'the,' 'is,' 'at,' 'which,' and 'on'—that are filtered out during the text normalization phase of an NLP pipeline because they carry minimal discriminative semantic value for relevance ranking. In a standard inverted index, removing these terms drastically reduces the size of the postings list without significantly harming retrieval effectiveness for most queries. The concept originates from Hans Peter Luhn's early work at IBM in the 1950s, where he observed that the most frequent words in English follow Zipf's Law and contribute little to distinguishing one document from another. Modern search engines like Elasticsearch do not use a static stop word list by default, instead relying on algorithmic weighting like BM25's inverse document frequency component to naturally downweight these terms.
Stop Word Removal vs. Other Text Normalization
A feature-level comparison of stop word removal against stemming, lemmatization, and lowercasing to clarify their distinct roles in the text normalization pipeline.
| Feature | Stop Word Removal | Stemming | Lemmatization |
|---|---|---|---|
Primary Objective | Eliminate low-information tokens | Reduce words to crude root form | Reduce words to dictionary base form |
Operates On | Entire token (word) | Word suffix (morphological ending) | Word's morphological analysis |
Output Type | Remaining content words | Truncated stems | Valid dictionary words (lemmas) |
Preserves Semantics | |||
Requires Dictionary/Corpus | |||
Typical Execution Speed | Very fast (lookup-based) | Fast (rule-based) | Slower (POS tagging + lookup) |
Example (Input: 'The cats were running') | 'cats', 'running' | 'the', 'cat', 'were', 'run' | 'the', 'cat', 'be', 'run' |
Primary Risk | Removing context-critical words | Over-stemming to non-words | Incorrect POS tag leading to wrong lemma |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding stop words requires familiarity with the broader text analysis pipeline. These interconnected concepts define how search engines preprocess, index, and score text to optimize relevance ranking.
Analyzer
The complete text processing pipeline that converts raw text into searchable tokens. An analyzer chains together a tokenizer with a sequence of filters—including stop word removal, lowercasing, and stemming—to produce a normalized token stream. In Elasticsearch and Lucene, analyzers are configurable per field, allowing different processing strategies for titles versus body text.
Inverted Index
A database index structure that maps each unique term to a postings list containing every document where that term appears. Stop word removal directly reduces the size of this index by eliminating high-frequency, low-value entries. Without filtering, terms like 'the' would dominate postings lists, bloating storage and slowing query evaluation without improving relevance.
TF-IDF
A numerical statistic that weights terms by combining term frequency with inverse document frequency. Stop words naturally receive extremely low IDF scores because they appear in nearly every document. Modern systems like BM25 incorporate this logic directly, making explicit stop word filtering less critical—the scoring function automatically downweights non-discriminative terms.
Tokenization Strategies
The process of segmenting raw text into discrete tokens before any filtering occurs. Tokenization decisions—such as splitting on whitespace versus punctuation—determine which character sequences become candidate stop words. Subword tokenizers like Byte-Pair Encoding (BPE) used in modern LLMs rarely employ traditional stop word lists, instead learning token importance from training data distributions.
Text Normalization
The broader standardization process that includes stop word filtering alongside stemming, lemmatization, lowercasing, and diacritic removal. The goal is to collapse morphological and orthographic variants into canonical forms. The order of normalization steps matters: stemming should typically occur after stop word removal to avoid processing terms destined for elimination.
Lexical Matching
The retrieval paradigm that relies on exact term overlap between query and document. Stop word removal directly impacts lexical matching by eliminating query terms that might be required for phrase matching. Removing 'to be' from a query for 'to be or not to be' would destroy the phrase entirely—illustrating why modern systems often retain positional information for stop words even when excluding them from scoring.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us