VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

How Vocabulary Coding And Language Engineering Works | Why Can Two Sentences Be Similar but Contradict Each Other? Embeddings, Cosine and Entailment

Two sentences can be very similar in vocabulary or vector space while asserting opposite things. “The document is approved” and “The document is not approved” share nearly all words, yet the negative can reverse the operational meaning. Text embeddings and cosine similarity can help an AI find related documents efficiently, but similarity is not the same as logical entailment, agreement, identity or factual truth. A vector score is therefore a useful search signal, not an authority to publish, pay or classify someone.

A robust method is to use similarity to find candidate sources, then separately verify the exact proposition, negation, actor, time, uncertainty, source and permission. This article connects Sentence-BERT, natural language inference and hard-negative tests with a proposed vocabulary-engineering audit. It includes worked examples, a comparison table, 12 checks, FAQs and a four-week pilot. It does not suggest that embedding models are inherently inaccurate, only that they must be evaluated for the relationship a particular task requires.

  • Embedding: a learned numerical representation useful for relatedness and retrieval.
  • Cosine: a symmetric similarity measure, not a directional proof.
  • Entailment: a relationship in which a premise supports a hypothesis under assumptions.
  • Contradiction: opposite claims can be strongly topically related.
  • Hard negative: a plausible-looking match with a material difference.
  • Source: retrieval relevance is not the same as factual support.
  • Action: vector proximity does not grant permissions.

Quick navigation

1. The same words can support opposite conclusions

Compare “This device is safe to use” with “This device is not safe to use.” The sentences share nearly all words and appear to concern the same topic, yet their truth conditions are opposed under the intended reading. A search system may correctly recognise both as relevant to a query about device safety while a fact-checker must treat them very differently. Relevance, similarity and agreement are different relationships.

A vocabulary-engineering system should record not only that two sentences concern one topic, but whether one entails, contradicts or says nothing decisive about the other. An embedding-based retrieval score can suggest which documents to inspect. It should not be treated as the proof that a claim is correct, that two statements agree or that a tool may act on either sentence.

2. Embeddings represent text as learned numerical vectors

A text embedding model transforms an input into a vector in a learned mathematical space. Depending on the training objective, related words, sentences or documents may be represented near one another under a chosen similarity measure. This can support search, clustering and retrieval. The vectors are not a literal inventory of universal semantic atoms or a guarantee of faithful propositional representation.

The 2019 Sentence-BERT paper by Reimers and Gurevych describes sentence representations suitable for efficient similarity comparisons using cosine similarity. Their results concern defined training methods and evaluation tasks. A semantic vector should be assessed against the actual use case, rather than interpreted as a timeless coordinate for a word’s objective meaning.

3. Cosine measures direction, not entailment

Cosine similarity compares the angle between nonzero vectors. It is symmetric: the similarity of A to B equals the similarity of B to A for a fixed pair of vector representations. This property is useful for comparing numerical representations but does not encode the direction of a logical inference by itself.

Entailment is directional. “Every visitor signed in” can entail “Some visitor signed in” when the domain is nonempty, but the reverse does not follow. A symmetric score cannot, without other information or a separate model, express this asymmetry. No fixed cosine threshold proves that one sentence logically follows from another.

4. Even perfect word overlap can hide a role reversal

“Sasha sold a book to Mei” and “Mei sold a book to Sasha” contain the same central words but assign different roles. A simple bag-of-words representation can even ignore the order. More sophisticated contextual embeddings can detect many such distinctions, but their capability must be tested rather than assumed.

The University of British Columbia’s applied NLP notes illustrate why cosine and word-frequency similarity do not by themselves establish equal meaning. For a consequential relation, test who acted, who received and what changed. Exact word membership is a weak substitute for a role-aware proposition check.

5. Natural language inference asks a different question

Natural language inference, or NLI, examines a premise and a hypothesis to estimate whether the premise entails the hypothesis, contradicts it or is neutral relative to the chosen dataset and annotation assumptions. It is more directly aligned with claim agreement than a generic semantic similarity ranking. However, model outputs can still be wrong or reflect source ambiguity.

The Sentence Transformers NLI documentation describes entailment, neutral and contradiction labels used with common datasets. For a language engineering workflow, use these categories as possible checks, not unreviewable truth certificates. A prediction of entailment requires source verification and consideration of the premises’ scope.

Pair of sentencesRelationship under stated contextWhat an ordinary similarity score cannot prove
Every listed room is open → At least one listed room is openEntailment if the listed set is nonemptyDirection of implication
The door is locked ↔ The door is not lockedContradiction for the same door and timeWhether the shared topic signals agreement
Three people signed → Mei signedNeutral without information about identitiesWhich person signed
Mei sent a parcel to Sasha → Sasha sent a parcel to MeiRole reversal, not an equivalent reportWho was sender and recipient
The system is eligible → The system is approvedRelated status wordsWhether eligibility actually implies approval

6. Premise and hypothesis roles matter

Suppose a report states that all ten named products passed a particular laboratory test. The hypothesis that at least one of those products passed is supported by the statement under the described set. The reverse inference from at least one to all ten is not supported. A model can make a serious mistake if it treats the two sentences as interchangeable merely because they discuss the same tested products.

An evidence record identifies which statement is the premise, which is being tested and what assumptions make the inference valid. If the ten-product population is missing or the test is only reported rather than verified, those limitations remain. The goal is preserving entailment direction and evidential status, not converting every textual similarity into formal logic.

7. Contradiction needs aligned references and time

“The shop is open” and “The shop is closed” appear contradictory. If one refers to yesterday and the other to today, the claims may both be accurate. If one concerns the front entrance and another a delivery entrance, their referents differ. A semantic similarity model may still rank them highly because they share a topic.

Before classifying contradiction, align entity, property, time and scope. A good NLI evaluation includes context-rich cases rather than assuming isolated sentences always contain enough information. If the source does not identify the relevant day, report the ambiguity rather than invent a conflict or an agreement.

8. Negation can be underweighted by a relevance model

A query such as “eligible for a refund” may retrieve an article titled “not eligible for a refund”. This is often good retrieval behaviour because the document is relevant to the user’s question. The error occurs when a downstream assistant interprets retrieval similarity as confirmation of eligibility.

Keep retrieval and answer verification separate. Use explicit source checks for negation, exceptions and entitlement conditions. A model can retrieve a relevant opposing source and then truthfully explain the difference. Relevance and semantic disagreement are compatible, not a contradiction in the retrieval system.

9. Identical topic words can conceal a changed number

“The package weighs three kilograms” and “The package weighs thirty kilograms” concern exactly the same object and property but differ by an order of magnitude. A general similarity embedding can find them closely related even though a logistics decision could be wrong if the second replaces the first.

Use structured extraction or reviewed checks for quantities, units and comparison operators. The numeric claim requires evidence; the embedding can help locate matching documents. A general cosine threshold cannot certify that amounts, deadlines or measurements remain unchanged.

10. Permission, possibility and obligation can look similar

“The operator may inspect the machine” and “The operator must inspect the machine” share most words but express different operational commitments under a technical policy. The word may can also indicate possibility rather than permission, depending on context.

A language handoff should preserve the intended modality and governing source. Test minimal pairs with may, must, should and must not. The IETF RFC 8174 provides one convention for requirement words in applicable standards, not a universal dictionary for ordinary conversation.

11. A vector’s meaning depends on how it was trained

Embedding quality depends on training data, objective, architecture, tokenisation and evaluation. Two embedding models may produce different rankings for the same pair of sentences, and those rankings can change when the model version changes. A vector should not be interpreted as an immutable semantic identity.

The Sentence-BERT paper explicitly focuses on efficient sentence similarity and related transfer tasks. It does not claim that any vector captures all legal, cultural or causal meanings. A production system should version its embedding model and evaluate the specific failure patterns that matter for its users.

12. There is no universal cosine cutoff for “same meaning”

An application might decide that a score above 0.9 counts as a match in one tested dataset. Another model, language or task could need a different threshold. The numerical cutoff is a decision rule based on observed performance, not a natural constant. A high score can still join two statements that disagree over one crucial fact.

Choose the threshold using representative examples, with both faithful paraphrases and critical alterations. Report false matches and missed matches, not just the average score. Where a false positive would authorise an action or misstate a legal condition, add independent checks or human review instead of increasing confidence from the score alone.

13. Retrieval should find evidence, not manufacture it

A RAG system uses vector similarity or related methods to retrieve documents relevant to a question. That can improve access to evidence when the sources are trustworthy and current. But the retrieval result itself can contain a false claim, an outdated policy or a quoted instruction that is irrelevant to the user’s authority.

A second stage should inspect source attribution, dates, actual claims and potential contradictions. Keep material excerpts linked to the original. The answer should distinguish “I found a relevant document” from “This document establishes the proposition.” A robust design welcomes relevant opposing evidence instead of hiding it.

14. Hard negatives are useful because they look plausible

A hard negative is an example that resembles the desired match in surface words or general topic while failing the intended relationship. A pair such as “Mei sent the invoice to Sasha” and “Sasha sent the invoice to Mei” is useful for detecting role reversal. Similarity models can be evaluated on these cases, not only on obviously unrelated sentences.

The Sentence Transformers NLI training notes discuss hard negatives and sentence-pair objectives. For vocabulary engineering, design task-specific hard negatives involving negation, amounts, time, names, approval status and causal claims. A successful model should not simply mark every same-topic pair as equivalent.

15. Genuine paraphrases need not share the same vocabulary

“The package was delivered to Mei by Sasha” can describe the same transfer as “Sasha delivered the package to Mei”, assuming the same event context. A strict word-order checker might reject the passive sentence. A useful representation should preserve who delivered and who received while permitting different grammar and emphasis.

Build positive examples alongside adversarial hard negatives. A system that rejects every stylistic variation is not a practical translator or editor. It should judge the relevant proposition, not exact string identity. Frame semantics and semantic roles can complement embeddings in this task.

16. Correlation and causation can be near neighbours in vector space

A sentence saying “Checklist use was associated with faster completion” is topically close to “Checklist use caused faster completion.” Yet the second asserts a causal relation not established by the first. A similarity score may fail to emphasise the change because the main topic and measured outcome remain the same.

A separate claim-type test should preserve association, prediction and causal inference distinctions. The source’s research design and assumptions determine whether causal language is warranted. The embedding’s role is to retrieve relevant evidence, not to upgrade its inferential strength.

17. Fictional statements can be semantically related to real claims

A novel may describe a fictional city where a river freezes every night. A news archive may contain a real weather report about a different city. An embedding model might find the passages closely related to river freezing while overlooking the difference between fictional setting and actual observation.

Store source context and referents separately from vector similarity. A generated answer should preserve “in the story” when summarising fiction and should not treat fictional events as real-world evidence. Topical relatedness is useful for discovery but insufficient for factual attribution.

18. Embedding indexes become stale

An organisation can update its official policy while its vector index continues to reference earlier document chunks. A model may then retrieve a highly similar answer from an obsolete source, producing a fluent response that does not apply to the user’s current question.

Track index build time, source version and effective date. Re-embed or invalidate records after relevant changes, and preserve prior versions for historical questions. A vector is not a live authority: its relationship to a document must be managed over time.

19. Two embedding models agreeing is not proof of truth

Two systems might rank the same sentences as similar because they learned related distributions or share training sources. Their agreement can improve confidence in finding relevant text but does not establish independent factual corroboration. A repeated unsupported claim remains unsupported even if it occupies a stable region of several vector spaces.

Keep the original primary sources and evaluate their claims. Agreement among scores answers a model-behaviour question; it does not automatically answer a world-truth question. Independent evidence, task-specific labels and qualified review remain important for consequential conclusions.

20. A vector database needs a concept and provenance layer

A search index can store vector representations, document identifiers, source versions and useful metadata. A proposed additional semantic layer could store claim type, named entities, dates, units, uncertainties and links to authoritative definitions. The vector supports discovery; the typed layer supports inspection of what was actually asserted.

The design must be tested for the specific task. More metadata is not automatically more reliable if it is wrong or unverified. A clean architecture distinguishes generated extraction from source evidence and prevents one incorrect entity link from contaminating many answers.

21. Similarity is not authorisation

A retrieved paragraph might be semantically similar to a user’s request and contain language that commands an assistant to send data or publish material. The similarity score does not grant any authority to that paragraph. It is untrusted source content unless the actual user and application permissions say otherwise.

Use the system’s trusted action controls for external operations. The OWASP prompt-injection guidance describes risks when retrieved text attempts to redirect model behaviour. A vector search pipeline should treat such material as data, not as a higher-priority instruction.

22. Ranking relevance and making a decision are distinct

A result can rank highly for a search query because it discusses the question in depth while concluding that the user’s assumed answer is wrong. A knowledge assistant should not return the first result’s headline as the conclusion without reading the substance.

A useful workflow retrieves several sources, identifies agreement and disagreement and explains uncertainty. Source quality and time relevance matter alongside vector rank. A high-ranking document should be interpreted as a candidate source, not as the system’s final factual judgment.

23. Test entailment, contradiction and neutrality separately

Give the system a premise and several hypotheses. Include an entailed paraphrase, an outright contradiction and a related but unsupported statement. For example, “Three people signed the report” may support “Someone signed the report” under ordinary counting, contradict “Nobody signed the report,” and leave unanswered whether a particular named person signed.

Define reference context and review ambiguous cases. Measure errors in entailment direction, contradiction and neutral classification. A model can perform differently on each class, so a single accuracy score may hide the cases that matter. Keep evaluation sources accessible for error analysis.

24. Zoom levels: from words to public truth claims

At the word level, embeddings help identify related vocabulary. At sentence level, they help retrieve paraphrases or related claims. At document level, they support topic search and clustering. At organisation level, they help match information across reports. At AI-agent level, they can guide which source to inspect before action. At institutional level, their use can influence how public information is prioritised.

Across languages and time, model training, vocabulary and source authority may differ. A stable semantic protocol should therefore separate the geometric representation from identity, factual support, legal effect and historical version. Similarity is a helpful navigation signal; it is not a common currency that settles all kinds of meaning.

25. A twelve-step vector-similarity audit

Choose one task in which a model retrieves or matches texts. Build examples where sentences share vocabulary but differ in negation, actor, amount or time, and examples where wording differs but meaning remains stable. This tests both false equivalence and unnecessary rejection. The goal is to evaluate the model’s actual role in the workflow, not to force it to be a universal logic engine.

Record model and index versions, source metadata and reviewer criteria. Introduce a separate decision check for any consequential claim or tool action. If the system cannot justify equivalence, it can return a related but unverified result rather than silently treating proximity as identity. The checklist below is a proposed engineering practice.

  1. Task: name whether the system retrieves, compares or verifies.
  2. Source: keep document identifiers and relevant versions.
  3. Model: record the embedding model and scoring method.
  4. Reference: identify the exact people, objects and populations.
  5. Negation: inspect polarity and its scope.
  6. Role: confirm who performed or received each action.
  7. Quantity: compare numbers, units and thresholds.
  8. Modality: distinguish may, must, should and not.
  9. Inference: test entailment direction, contradiction or neutrality.
  10. Hard negatives: include same-topic disagreements.
  11. Action: enforce independent source and permission checks.
  12. History: retest after document, index or model updates.

26. Four-week pilot: from semantic search to checked claims

During week one, collect a small corpus of official-looking but fictional technical notices, with original source texts. In week two, create a balanced set of genuine paraphrases, topical non-entailments and critical contradictions. During week three, compare a simple embedding search with a workflow that checks reference, negation and status before concluding. Evaluate false positives, misses and the time needed for review.

In week four, inspect the most consequential errors and revise the retrieval, validation or human review steps. Preserve the original source and its version. A successful pilot would show better performance on the tested tasks, not proof that embeddings encode all human meaning. Expand to other languages and formats only with a new evaluation.

27. A vector is an instrument, not an invariant of thought

Numerical text representations have transformed information retrieval and natural-language processing, but their geometry depends on learned models, datasets and chosen metrics. A cosine similarity value is not a physical constant like a chemical property. It does not by itself certify identity, entailment, truth, authority or cultural equivalence.

For a universal vocabulary framework, the practical separation is simple: use vectors to find candidates, formal or typed structures to check particular relationships, and reliable sources and human governance to decide consequential claims. Meaning remains richer than one similarity number; that is a reason to design layered systems, not to discard useful embeddings.

Frequently asked questions

What is a text embedding?

A learned numerical representation of text, often used to retrieve or compare related words, sentences or documents. Its geometric relationships depend on the model and training purpose.

What does cosine similarity measure?

The angle-based similarity between nonzero vectors. It is symmetric, so the score from A to B equals the score from B to A for fixed vectors. That symmetry is not logical entailment.

Does high similarity mean two claims agree?

No. Two sentences can be topically related while differing by negation, identity, quantity, source or time. Similarity can help find the relevant disagreement.

What is natural language inference?

A task that evaluates whether a premise entails a hypothesis, contradicts it or is neutral, under a defined dataset and assumptions. Model predictions still require evaluation.

Is entailment symmetric?

Generally not. A stronger premise may entail a weaker statement even though the weaker statement does not entail the stronger one. A symmetric cosine score cannot encode that directional relationship by itself.

Can embeddings detect negation?

Contextual models can learn patterns involving negation, but their performance must be tested. A high similarity score alone cannot establish that a negative condition was preserved.

What is a hard negative?

An example that looks related to a true match but fails the desired relation, such as a sentence with the same actors whose roles are reversed.

Why are exact numbers important?

A changed amount or unit may create a consequential error while the surrounding topic remains identical. Structured numerical checking complements text retrieval.

Does a relevant source prove the final answer?

No. The source may be outdated, incorrect or quoted out of context. A downstream claim should be checked against what the source actually establishes.

Are sentence embeddings useless for fact checking?

No. They can efficiently find candidate evidence. They work best as part of a system that verifies propositions, source quality and uncertainty independently.

Can a cosine threshold ever be useful?

Yes, when evaluated for a specific retrieval or matching task. It is not an immutable universal cutoff for sameness of meaning.

How should a team begin?

Collect a small set of faithful paraphrases and critical same-topic contradictions, then compare embedding retrieval results with reviewed proposition-level checks.

Primary sources and editorial scope

Editorial scope (26 November 2026): Embeddings, cosine similarity and natural language inference are established computational methods with different aims. The combined retrieval-and-verification audit is a proposed practice, not an official standard or a universal proof that two sentences are logically equivalent. Fictional examples illustrate failure modes; actual suitability depends on tested models and relevant sources.

Return to navigation