LLMs Under the HoodBarry S. StahlPrincipal Engineer - AZNerds.net@bsstahl@cognitiveinheritance.comhttps://CognitiveInheritance.com |
|
Favorite Physicists
Other notables: Stephen Hawking, Edwin Hubble, Leonard Susskind, Christiaan Huygens |
Favorite Mathematicians
Other notables: Blaise Pascal, Daphne Koller, Grady Booch, Evelyn Berezin, Pascal Van Hentenryck |
|
|
|
|
|
|
|
|
|
A neural network model that learned dense vector representations of words
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GPT-3 and beyond use the
|
|
|
|
|
Reference Implementation - AI Demos on GitHub
|
|
|
|
Article: Depth of GPT Embeddings
|
|
|
|
Note: For normalized vectors, cosine similarity is the same as the dot-product |
|
| Feature | Example |
|---|---|
| Synonym | "Happy" is closer to "Joyful" than to "Sad" |
| Language | "The Queen" is very close to "La Reina" |
| Idiom | "He kicked the bucket" is closer to "He died" than to "He kicked the ball" |
| Sarcasm | "Well, look who's on time" is closer to "Actually Late" than "Actually Early" |
| Homonym | "Bark" (dog sound) is closer to "Howl" than to "Bark" (tree layer) |
| Collocation | "Fast food" is closer to "Junk food" than to "Fast car" |
| Proverb | "The early bird catches the worm" is closer to "Success comes to those who prepare well and put in effort" than to "A bird in the hand is worth two in the bush" |
| Metaphor | "Time is money" is closer to "Don't waste your time" than to "Time flies" |
| Simile | "He is as brave as a lion" is closer to "He is very courageous" than to "He is a lion" |
|
|
|
|
|
|
|
|
|
|
|
|
Step 1: Download the Host
Step 2: Install the Models
openai/gpt-oss-20b or gpt-oss:20bnomic-ai/nomic-embed-text-v2-moe-GGUF or nomic-embed-textStep 3: Verify Installation
curl http://localhost:1234/v1/embeddings \
-H "Content-Type: application/json" \
-d '{
"model": "nomic-embed-text-v2-moe",
"input": ["This is a test sentence."]
}'
|
|
|
|
|
The 3 matrices that are learned in training of the attention mechanism
Multiplying these matrices by the positionalized input adds the appropriate context to each token |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The robot could not lift the crate because it was too heavy.
The adjective changes which earlier noun best completes the causal relationship. Attention can carry contextual influence. It does not prove a faithful reasoning path or a correct answer.
|
|
|
|
Labeled examples show the model what the right answer looks like
Features are the details the model is allowed to use
Target classes are the labels the model is allowed to predict
Training searches for a pattern from features to target class
Prediction applies that pattern to an unlabeled input
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mapping user and system text to validated, known-safe representations to ensure consistent behavior and defend against prompt injection
|
|
Determines if the input is an affirmative or negative response to a question
Determines the emotional tone of a response
|
|
|
|
|
|
Query: How can I stop my laptop battery from draining overnight?
Rank these from 1–4 by semantic similarity (1 = closest)
Which result might keyword overlap rank too highly?
|
|
|
|
|
|
| Need | Choose | Reasons |
|---|---|---|
| Identifiers, legal phrases, error codes, etc | Keyword | deterministic and easy to validate |
| Similar meaning, ranking, clustering, etc | Vector | fast semantic retrieval when prose adds no value |
| Relationships, paths, dependencies, etc | Graph | preserve and traverse known structure |
| Exact anchors plus natural-language intent | Hybrid | combine lexical precision with semantic recall |
Add an LLM only when the result requires synthesis, ambiguity resolution, or generated language. Attention does not search an external corpus.
|
|
|
|
|
|
|
|
|
|
|
What is the warranty period for the FluxWave 3000 router? |
|
The FluxWave 3000 is a next-generation tri-band router designed for high-density smart homes and small offices. It features adaptive beamforming, automatic channel optimization, and a thermal-balanced chassis that keeps performance stable under heavy load. The router supports up to 120 simultaneous device connections, includes a modular antenna system for extended range, and integrates a lightweight diagnostics dashboard for real-time traffic analysis. Although it is engineered for durability, the FluxWave 3000 comes with a 3-year limited hardware warranty that covers manufacturing defects but excludes accidental damage or environmental exposure. Its firmware is updated quarterly to maintain security compliance and improve mesh-network performance. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Consider carefully what context matters to your users
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl or Postman
|
|
|
|