<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Plain Simple Software - Medium]]></title>
        <description><![CDATA[Helping people learn more about software: how to build it, how to change it, and how to innovate with it - Medium]]></description>
        <link>https://medium.com/plain-simple-software?source=rss----2e136f44ab69---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Plain Simple Software - Medium</title>
            <link>https://medium.com/plain-simple-software?source=rss----2e136f44ab69---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:55:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/plain-simple-software" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Proteus: why AI memory should unlock gradually]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/plain-simple-software/proteus-why-ai-memory-should-unlock-gradually-ef3f30e478f0?source=rss----2e136f44ab69---4"><img src="https://cdn-images-1.medium.com/max/1080/1*zSnidcnw-s-4f5Q2h2QtpQ.png" width="1080"></a></p><p class="medium-feed-snippet">The memory footprint stays fixed. What changes is when the model can use it.</p><p class="medium-feed-link"><a href="https://medium.com/plain-simple-software/proteus-why-ai-memory-should-unlock-gradually-ef3f30e478f0?source=rss----2e136f44ab69---4">Continue reading on Plain Simple Software »</a></p></div>]]></description>
            <link>https://medium.com/plain-simple-software/proteus-why-ai-memory-should-unlock-gradually-ef3f30e478f0?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/ef3f30e478f0</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-research]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 19:11:02 GMT</pubDate>
            <atom:updated>2026-11-21T19:11:02.030Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Titans: a memory that learns while the model reads]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/plain-simple-software/titans-a-memory-that-learns-while-the-model-reads-26897e768afa?source=rss----2e136f44ab69---4"><img src="https://cdn-images-1.medium.com/max/1080/1*O4HSiZFku8CsUWfTsaq-6w.png" width="1080"></a></p><p class="medium-feed-snippet">Test-time memory updates are not the same thing as saving a conversation.</p><p class="medium-feed-link"><a href="https://medium.com/plain-simple-software/titans-a-memory-that-learns-while-the-model-reads-26897e768afa?source=rss----2e136f44ab69---4">Continue reading on Plain Simple Software »</a></p></div>]]></description>
            <link>https://medium.com/plain-simple-software/titans-a-memory-that-learns-while-the-model-reads-26897e768afa?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/26897e768afa</guid>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[ai-research]]></category>
            <category><![CDATA[transformers]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 19:44:57 GMT</pubDate>
            <atom:updated>2026-11-20T19:44:58.566Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Constrained decoding: make invalid tokens unavailable]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/plain-simple-software/constrained-decoding-make-invalid-tokens-unavailable-8208ba36e802?source=rss----2e136f44ab69---4"><img src="https://cdn-images-1.medium.com/max/1080/1*-x4dxptTfv7J68F84HXqyA.png" width="1080"></a></p><p class="medium-feed-snippet">Valid JSON is a generation rule, not a promise of a correct answer.</p><p class="medium-feed-link"><a href="https://medium.com/plain-simple-software/constrained-decoding-make-invalid-tokens-unavailable-8208ba36e802?source=rss----2e136f44ab69---4">Continue reading on Plain Simple Software »</a></p></div>]]></description>
            <link>https://medium.com/plain-simple-software/constrained-decoding-make-invalid-tokens-unavailable-8208ba36e802?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/8208ba36e802</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-research]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 22:46:01 GMT</pubDate>
            <atom:updated>2026-11-17T22:46:01.539Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[JEV makes judgments. Code makes decisions.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/plain-simple-software/jev-makes-judgments-code-makes-decisions-115c1e786d87?source=rss----2e136f44ab69---4"><img src="https://cdn-images-1.medium.com/max/1080/1*72WCwjBVYaH1MiTTM-94UA.png" width="1080"></a></p><p class="medium-feed-snippet">A structured answer is useful when you know what your application will do with it.</p><p class="medium-feed-link"><a href="https://medium.com/plain-simple-software/jev-makes-judgments-code-makes-decisions-115c1e786d87?source=rss----2e136f44ab69---4">Continue reading on Plain Simple Software »</a></p></div>]]></description>
            <link>https://medium.com/plain-simple-software/jev-makes-judgments-code-makes-decisions-115c1e786d87?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/115c1e786d87</guid>
            <category><![CDATA[decision-model]]></category>
            <category><![CDATA[ai-research]]></category>
            <category><![CDATA[typesafe-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 14:31:01 GMT</pubDate>
            <atom:updated>2026-11-16T14:31:01.641Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[e-means: faster clustering without changing the objective]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/plain-simple-software/e-means-faster-clustering-without-changing-the-objective-4815c4b844c8?source=rss----2e136f44ab69---4"><img src="https://cdn-images-1.medium.com/max/1080/1*iWEcCZk_eYaeBFdH8SDXAQ.png" width="1080"></a></p><p class="medium-feed-snippet">The trick is to remember counts and sums, not just move centroids.</p><p class="medium-feed-link"><a href="https://medium.com/plain-simple-software/e-means-faster-clustering-without-changing-the-objective-4815c4b844c8?source=rss----2e136f44ab69---4">Continue reading on Plain Simple Software »</a></p></div>]]></description>
            <link>https://medium.com/plain-simple-software/e-means-faster-clustering-without-changing-the-objective-4815c4b844c8?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/4815c4b844c8</guid>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[meta]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[ai-research]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 22:16:01 GMT</pubDate>
            <atom:updated>2026-11-15T22:16:01.566Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How DeepSeek scales prefill and decode]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/plain-simple-software/how-deepseek-scales-prefill-and-decode-7ad70c32b91d?source=rss----2e136f44ab69---4"><img src="https://cdn-images-1.medium.com/max/720/1*FWU4jNBo4Mu8dyMEA6Po2A.png" width="720"></a></p><p class="medium-feed-snippet">Different demand signals, reserved capacity, and two distinct ways to take a decode instance out of service</p><p class="medium-feed-link"><a href="https://medium.com/plain-simple-software/how-deepseek-scales-prefill-and-decode-7ad70c32b91d?source=rss----2e136f44ab69---4">Continue reading on Plain Simple Software »</a></p></div>]]></description>
            <link>https://medium.com/plain-simple-software/how-deepseek-scales-prefill-and-decode-7ad70c32b91d?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/7ad70c32b91d</guid>
            <category><![CDATA[deepseek]]></category>
            <category><![CDATA[ai-research]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[transformers]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 17:41:01 GMT</pubDate>
            <atom:updated>2026-11-14T17:41:01.616Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[GPT-OSS 120B explained: architecture, memory and tool execution]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/plain-simple-software/gpt-oss-120b-explained-architecture-memory-and-tool-execution-38ac08d09160?source=rss----2e136f44ab69---4"><img src="https://cdn-images-1.medium.com/max/1080/1*rYiLV39v2aesMI7dYPu7MQ.png" width="1080"></a></p><p class="medium-feed-snippet">GPT-OSS 120B has roughly 117 billion parameters, with about 5.1 billion active per token. That gap explains much of its architecture. It&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/plain-simple-software/gpt-oss-120b-explained-architecture-memory-and-tool-execution-38ac08d09160?source=rss----2e136f44ab69---4">Continue reading on Plain Simple Software »</a></p></div>]]></description>
            <link>https://medium.com/plain-simple-software/gpt-oss-120b-explained-architecture-memory-and-tool-execution-38ac08d09160?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/38ac08d09160</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 04:17:59 GMT</pubDate>
            <atom:updated>2026-11-14T04:18:36.870Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Mastering Vector Similarity: The Essential Guide for Generative AI Interview Prep and AI Careers]]></title>
            <link>https://medium.com/plain-simple-software/mastering-vector-similarity-the-essential-guide-for-generative-ai-interview-prep-and-ai-careers-62c6054eb738?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/62c6054eb738</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[vector-database]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Wed, 13 May 2026 21:05:08 GMT</pubDate>
            <atom:updated>2026-05-13T21:05:08.096Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Backbone of Modern AI Careers</h4><p>In the rapidly evolving landscape of <strong>Generative AI</strong>, understanding the mechanics of how machines “reason” is no longer optional — it is a prerequisite. At the heart of this revolution lies a concept that bridges the gap between raw data and semantic understanding: <strong>Vector Similarity</strong>.</p><p>Whether you are diving into <strong>interview prep</strong> for a machine learning role or looking to pivot your <strong>AI career</strong> toward large language models (LLMs), mastering vector similarity is your secret weapon. This guide explores the technical foundations, its role in Generative AI, and the specific questions you need to prepare for in your next high-stakes interview.</p><h3>What is Vector Similarity?</h3><p>To understand vector similarity, we first must understand embeddings. In traditional computing, data is often treated as literal strings or discrete values. However, Generative AI models like GPT-4 or Claude see the world through “vectors” — long lists of numbers that represent the features of a piece of data in high-dimensional space.</p><p><strong>Vector Similarity</strong> is the measure of how close two vectors are to each other in this space. If two pieces of text (or images) are semantically similar — like “King” and “Queen” — their vectors will be positioned near each other.</p><h3>Common Similarity Metrics</h3><p>When preparing for an AI career, you must be able to distinguish between different ways of calculating similarity:</p><ol><li><strong>Cosine Similarity:</strong> Measures the cosine of the angle between two vectors. This is the most popular metric in Generative AI because it focuses on the direction of the vectors rather than their magnitude.</li><li><strong>Euclidean Distance (L2 Norm):</strong> Measures the straight-line distance between two points. It is highly sensitive to the magnitude of the data.</li><li><strong>Dot Product:</strong> A mathematical operation that multiplies corresponding entries and sums them up. It is often used in transformer architectures (like self-attention mechanisms).</li></ol><h3>The Role of Vector Similarity in Generative AI</h3><p>Generative AI has a “hallucination” problem. Because models are trained on static datasets, they often lack up-to-date or proprietary information. This is where <strong>Retrieval-Augmented Generation (RAG)</strong> comes in, and RAG is entirely powered by vector similarity.</p><h3>How RAG Works</h3><ol><li><strong>Ingestion:</strong> Your documents are broken into chunks and converted into vectors using an embedding model.</li><li><strong>Storage:</strong> These vectors are stored in a <strong>Vector Database</strong> (like Pinecone, Milvus, or Weaviate).</li><li><strong>Retrieval:</strong> When a user asks a question, the system converts that question into a vector and uses vector similarity to find the most relevant chunks of data from the database.</li><li><strong>Augmentation:</strong> The relevant data is fed to the LLM to provide an accurate, context-aware answer.</li></ol><p>Without vector similarity, the “retrieval” in RAG would be impossible, making it a cornerstone skill for anyone building real-world AI applications.</p><h3>AI Careers: Why This Skill is in High Demand</h3><p>The job market for AI professionals has shifted. While 2021 was about training models from scratch, 2024 and beyond are about <strong>AI Orchestration</strong>. Companies are looking for engineers who can optimize search retrieval, manage vector databases, and improve the accuracy of RAG pipelines.</p><p>Roles such as AI Solutions Architect, Retrieval Engineer, and LLM Ops Specialist require a deep understanding of how to tune similarity thresholds to balance precision and recall. Mastering these nuances allows you to stand out in a sea of applicants who only know how to call an API.</p><h3>Interview Prep: Top Vector Similarity Questions</h3><p>If you are currently in the <strong>interview prep</strong> phase for an AI role, expect your technical interviewers to dig deep into vector search. Here are some common questions and how to approach them:</p><h3>1. When would you use Cosine Similarity over Euclidean Distance?</h3><ul><li><strong>Answer:</strong> Use Cosine Similarity when the frequency or magnitude of the data doesn’t matter as much as the content. For example, in text analysis, a long document and a short document might cover the same topic. Cosine similarity will recognize them as similar despite their different lengths.</li></ul><h3>2. What is the ‘Curse of Dimensionality’?</h3><ul><li><strong>Answer:</strong> As the number of dimensions increases, the distance between any two points becomes nearly the same, making it difficult to distinguish similarity. This is why choosing the right embedding model and dimensionality reduction techniques is crucial.</li></ul><h3>3. How do Vector Databases handle millions of records so quickly?</h3><ul><li><strong>Answer:</strong> They use <strong>Approximate Nearest Neighbor (ANN)</strong> algorithms. Instead of comparing a query to every single vector (which is slow), they use indexing structures like HNSW (Hierarchical Navigable Small World) or IVF (Inverted File Index) to narrow down the search space instantly.</li></ul><h3>4. How do you handle ‘False Positives’ in vector retrieval?</h3><ul><li><strong>Answer:</strong> This involves tuning the similarity threshold, improving the quality of the embeddings, or using a ‘Re-ranker’ model that performs a more computationally expensive check on the top 10–20 results returned by the vector search.</li></ul><h3>Conclusion: Your Path Forward in AI</h3><p>Vector similarity is the invisible thread that connects user intent to machine intelligence. As you navigate your <strong>AI career</strong>, remember that the tools (like LangChain or LlamaIndex) will change, but the underlying mathematical principles of vector space remain constant.</p><p>To excel in your <strong>interview prep</strong>, don’t just memorize definitions. Build a project that utilizes a vector database, experiment with different similarity metrics, and understand the trade-offs between speed and accuracy. The future of Generative AI is built on vectors — make sure you know how to navigate them.</p><p>Like this article? Want to keep up with LLMs? Follow me, <a href="https://medium.com/@ytang07">Yujian Tang</a>, for more posts about AI, Software, and Growth. Make sure to follow <a href="https://medium.com/plain-simple-software">Plain Simple Software</a> for more software articles too!</p><h3>About the Author</h3><p><a href="https://www.linkedin.com/in/yujiantang">Yujian Tang</a> is an experienced AI Engineer and entrepreneur who has over 20,000 learners on LinkedIn Learning. He has given lectures at Stanford, hosted over 50 hackathons, built a <a href="http://lu.ma/oss4ai">~50k person event calendar</a>, and started <a href="http://reddit.com/r/ai_agents">r/AI_Agents</a> — a subreddit with over 350k agent builders.</p><h3>Related Articles</h3><ul><li><a href="https://crackingthegenerativeaiinterview.com/blog/decoding-vector-database-architectures-high-performance-retrieval">Decoding Vector Database Architectures: A Deep Dive into High-Performance Retrieval</a></li><li><a href="https://crackingthegenerativeaiinterview.com/blog/mastering-vector-indexing-ai-semantic-search">Mastering Vector Indexing: The Architecture Behind High-Performance AI and Semantic Search</a></li><li><a href="https://crackingthegenerativeaiinterview.com/blog/vector-distance-metrics-generative-ai-interview-prep">Mastering Vector Distance Metrics for Generative AI: The Ultimate Interview Prep Guide</a></li><li><a href="https://crackingthegenerativeaiinterview.com/blog/mastering-embedding-models-generative-ai-interview-prep">Mastering Embedding Models: Your Essential Guide for Generative AI Interview Prep and AI Careers</a></li><li><a href="https://crackingthegenerativeaiinterview.com/blog/dense-vs-sparse-vectors-generative-ai-interview-prep">Dense vs Sparse Vectors: The Ultimate Guide for Generative AI Interview Prep</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62c6054eb738" width="1" height="1" alt=""><hr><p><a href="https://medium.com/plain-simple-software/mastering-vector-similarity-the-essential-guide-for-generative-ai-interview-prep-and-ai-careers-62c6054eb738">Mastering Vector Similarity: The Essential Guide for Generative AI Interview Prep and AI Careers</a> was originally published in <a href="https://medium.com/plain-simple-software">Plain Simple Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2025 LLM App Stack]]></title>
            <link>https://medium.com/plain-simple-software/2025-llm-app-stack-dbfa44df6c8c?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/dbfa44df6c8c</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yujian Tang]]></dc:creator>
            <pubDate>Tue, 06 May 2025 17:36:43 GMT</pubDate>
            <atom:updated>2025-05-06T17:36:42.969Z</atom:updated>
            <content:encoded><![CDATA[<h4>46 Deployment, Orchestration, Observability, Inference, Data Storage, and Data Movement tools covered</h4><p><em>For weekly updates to the scene, make sure you follow the </em><a href="http://ai-agents-weekly.beehiiv.com/"><em>r/AI_Agents Weekly Newsletter</em></a><em>!</em></p><p>Last year we had a jam packed app stack, this year, we’re seeing lots of new tools. I’ve removed some tools that aren’t “AI Native”, and instead am focusing this stack on general LLM application based tooling. Later on, I’ll release a piece on Agents and Applications.</p><p>This article is meant as a starting point for you to get your options and start doing research on each of these technologies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHrYyiaFAbEExc4j6gbpjQ.png" /></figure><h3>Deployment</h3><p>Once you build an app, you want to deploy it into production, these are the tools for deployment. Probably the least crowded category, but none of these tools are truly “AI Native” because deployment is a universal task.</p><ul><li>AWS</li><li>GCP</li><li>Docker</li><li>Azure</li><li>Digital Ocean</li></ul><h3>Orchestration</h3><p>Possibly the most crowded space, these are what people commonly refer to as “frameworks”. Think about tools like React, FastAPI, Flask, and so on, but for LLM applications.</p><ul><li>BAML</li><li>Pixeltable</li><li>LangChain</li><li>LiquidMetal</li><li>SmolAgents by HuggingFace</li><li>LlamaIndex</li><li>Langflow</li><li>Orkes</li><li>Inngest</li><li>Gooey AI</li><li>CrewAI</li><li>GenSX</li><li>Tambo</li></ul><h3>Observability</h3><p>Observability is to LLM Apps like logging is to software. You need it to know what’s going on. These tools help you peek under the hood and understand what your application is really doing.</p><ul><li>Arize AI</li><li>Comet</li><li>AgentOps</li><li>Galileo</li><li>Patronus AI</li><li>Maxim AI</li><li>Helicone</li><li>Fiddler AI</li><li>LangFuse</li></ul><h3>Inference</h3><p>This is the backbone of LLM applications, these are the providers for LLM inference, which drive generative AI capabilities.</p><ul><li>OpenAI</li><li>GMI Cloud</li><li>Tensorwave</li><li>Nebius</li><li>Anthropic</li><li>Llama by Meta</li><li>FriendliAI</li><li>Shadeform</li><li>Lamini</li><li>Predibase</li></ul><h3>Data Storage</h3><p>As we all know, data is important for any software application, for LLM applications, these are some common data storage options. You’ll notice that the core thing that combines these is their vector capabilities, which is incredibly important for semantic similarity in generative AI applications.</p><ul><li>Pinecone</li><li>Zilliz</li><li>Top K</li><li>LanceDB</li><li>Weaviate</li><li>MongoDB</li><li>MotherDuck</li><li>Qdrant</li></ul><h3>Data Movement</h3><p>These tools are typically used *before* the generative AI capabilities to move data around from where it’s currently stored to your new data storage solution. These can also be used to move and sync data during the lifetime of an application.</p><ul><li>Unstract</li><li>Databricks</li><li>Snowflake</li><li>Flink</li><li>Kafka</li><li>Airbyte</li></ul><p>Like this article? Want to keep up with LLMs? Follow me, <a href="https://medium.com/@ytang07">Yujian Tang</a>, for more posts about AI, Software, and Growth. Make sure to follow <a href="https://medium.com/plain-simple-software">Plain Simple Software</a> for more software articles too!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbfa44df6c8c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/plain-simple-software/2025-llm-app-stack-dbfa44df6c8c">2025 LLM App Stack</a> was originally published in <a href="https://medium.com/plain-simple-software">Plain Simple Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Hierarchical Vector Concatenation (HVC)]]></title>
            <link>https://medium.com/plain-simple-software/introducing-hierarchical-vector-concatenation-hvc-c7ef9cc734d3?source=rss----2e136f44ab69---4</link>
            <guid isPermaLink="false">https://medium.com/p/c7ef9cc734d3</guid>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[euclidean-distance]]></category>
            <category><![CDATA[vectorization]]></category>
            <category><![CDATA[machine-learning-math]]></category>
            <dc:creator><![CDATA[Michelangiolo Mazzeschi]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 01:42:15 GMT</pubDate>
            <atom:updated>2024-06-17T11:34:23.872Z</atom:updated>
            <content:encoded><![CDATA[<h4>Linear Algebra</h4><h4>Introducing one innovative technique to concatenate sets of vectors</h4><p>Concatenating vectors is a known technique of merging features from two or more vectors. This algorithm has been extensively used in Machine Learning to test the capabilities of new models. Lately, this technique has been used for multimodal purposes by merging the results from different embeddings.</p><p>However, what actually happens when we mix different vectors? And is there a smarter way to combine them by just concatenating them? In this article, I am going to introduce a <strong>novel approach to concatenate vectors</strong> by <strong>properly </strong>scaling one of them.</p><blockquote>***Through the following article I am trying to introduce several new algorithms. Because I have not been able to find any similar solutions to the problem I am facing on the web, I tried solving it myself. <strong>I am open to criticism</strong> and <strong>happy to remove this article</strong> if you can prove the solution already exists.<br>Source code available on my <a href="https://github.com/atlantis-nova/hierarchical-vector-concatenation">github repo</a>.</blockquote><h4>Understanding vector concatenation</h4><p>The most pertinent question, as of now, would be: what happens to two vectors when we concatenate them? This process is outlined clearly in the following image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*DfB43nRoWWfFRiV87xpbYQ.png" /><figcaption>concatenating a 1-dimensional vector set with 2-dimensional vector set</figcaption></figure><p><strong>By increasing the number of dimensions, we are separating the different classes (we can call this phenomenon vector split).</strong></p><p>Let us look at a practical, and clearer, example. <br>Let us define <strong>two sets of vectors</strong>:</p><ul><li><strong>S1</strong>: a set of <strong>2-dimensional vectors</strong>:<br> [(.3, .2), (.5, .7), (.2, .9)…]</li><li><strong>S2</strong>: a set of <strong>1-dimensional vectors</strong>:<br> [(.2), (.3), (.8)…]</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*3YXz-Tm21TDAc1UfEeXyTA.png" /></figure><p>Our goal is to concatenate the two sets in a hierarchical way, so that:</p><ul><li>S3 will be a <strong>3-dimensional vector</strong></li><li>S2 will be given priority over S1 (in layman&#39;s terms, each vector of S1 — and lower sets if existing — <strong>will belong </strong>to a vector of S2.<br>Ex. the outline <strong>S1 vector (0.2, 0.9)</strong> will belong to <strong>class C (0.8)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*DfB43nRoWWfFRiV87xpbYQ.png" /></figure><p>A simple concatenation is able to split the vectors, but <strong>NOT COMPLETELY:</strong> meaning that a sample from a class can reach (through the nearest neighbors algorithm) other classes that are closer in space:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*xRlKwL1QeigqTQkYFzpY9A.png" /><figcaption>KNN(B) = B, A, B, C…</figcaption></figure><p>As we can see, a sample belonging to B reaches another sample belonging to class <strong>B</strong>, then <strong>A</strong>, then <strong>B</strong> again, then <strong>C</strong>… Let us call these exceptions as <strong>contaminations</strong>:</p><blockquote><strong>When performing a k-nn on any datapoint k</strong>, let K be the results (sorted by distance) of a k-nn algorithm (and its elements the other k in our dataset that are neighbors of k) so that K= {k₁, k₂, …, kₙ_1}, where kᵢ ∈ ℂ for some class ℂ.</blockquote><blockquote>Then, an element kᵢ is said to be an <strong>contamination </strong>if: ∃ℂ ⊆ K, kᵢ ∈ ℂ, and ∀j &lt; i, kⱼ ∉ ℂ</blockquote><p>Ex. in the example above, A is a contamination, as it appears before all the elements of class B are exhausted. In conclusion, <strong>by performing a simple concatenation, the hierarchy of the first set of vectors (S1) is not enforced.</strong></p><h4>Scaling in vector concatenation</h4><p>However, something more interesting happens <strong>when we scale</strong> the highest set of vectors in the hierarchy, (in our case the 1-dimensional portion S1): by increasing the coefficient we use to scale it, <strong>we progressively diminish the number of contaminations. </strong>This <strong>“vector split”</strong> can extended up to the point <strong>that no contaminations are left</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mPu7iYVIWulZwo6XqptxjA.png" /><figcaption>Effect on contaminations when scaling S1 by a scalar</figcaption></figure><p>By applying a scalar multiplication (defined by the variable <strong>x</strong>)<strong> to</strong> <strong>every element of S2</strong>:</p><ul><li>the relationship between the vectors belonging to each class remains intact</li><li>the relationship between each class remains intact</li><li>the relationship between the vectors between different classes change</li></ul><p>With an increase of <strong>x</strong>, all our datapoints with a shift in the opposite direction of the origin (only for the dimensions where the scalar multiplication is applied):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Il0bRGXL3q360zOtw7Je2w.png" /><figcaption>visualization of vector scaling on a 2D plane</figcaption></figure><p>We can picture this visualization on a 3D plane (S1 of length 2, S2 of length 1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*SFG9-U_XHsL8XA_4Gv7Jag.png" /><figcaption>Effect of scaling on a 3D plane</figcaption></figure><h3>Computing MSC: Minimum Scale Coefficient</h3><p>Is it possible to find the <strong>minimum scalar</strong> that when used to scale the highest vector of the hierarchy we separate the existing dimensions <strong>far enough to remove all contaminations</strong>?</p><p>We call this <strong>minimum scale coefficient</strong> <strong>(MSC)</strong>, and we are going to use a <strong>brute-force approach</strong> to compute it, as well as check is reliability.</p><h4>1. Tracing a path for each class</h4><p>We first want to start by making sure each class is separated from the others. For each existing class c ∈ ℂ, we can sort the remaining classes in order of distance (a simple knn), trace<strong> a path following this order, </strong>and create a dedicated path called<strong> p</strong>. The formal definition will be:</p><blockquote>Let ℂ be the set of all classes. Then, for each class c ∈ ℂ, there exists a set p such that:</blockquote><blockquote>|p| = |ℂ| and P = {p₁, p₂, …} = {p : |p| = |ℂ|}</blockquote><p>Ex. for cᵢ = <strong>A</strong> (class A), the <strong>path</strong> will be <strong>A</strong> -&gt; <strong>C</strong> -&gt; <strong>B</strong> -&gt; <strong>D</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZuBRagPOChN7PdoH5607g.png" /><figcaption>path traced from each class</figcaption></figure><p>By creating several paths <strong>we can get rid of contaminations</strong> by ensuring the distance between any point of A is shorter than the distance between the current and the next class iteratively.</p><p>For example, <strong>for the first path starting from A</strong>, for all the samples belonging to class A we can compute the necessary MSC to separate all the remaining classes and remove all contaminations. However, for a sample starting from class B, its MSC will be different and will also need to be computed.</p><h4>2. Separating all classes in each path</h4><p>Now that we have obtained a path <strong>p </strong>for each class, we can proceed to separate each of its samples iteratively. From this <strong>path</strong>, we can create a <strong>sequence</strong> of triplets made of:</p><ul><li><strong>c₀:</strong> the class c where the current k is residing (equivalent to the starting class of the path )</li><li><strong>c</strong>ᵢ:<strong> </strong>the class we have not yet separated</li><li><strong>c</strong>ᵢ₊₁: the class after the one we have not separated</li></ul><p>Because for the first iteration, we want to start separating A and B, rather than a triplet, we will only find [(<strong>c₀</strong>, <strong>c₀</strong>), (<strong>c₀</strong>, <strong>c</strong>₁)].</p><p>Now we can clarify: why is s1 <strong>a</strong> <strong>pair</strong> and <strong>not a triplet</strong>?, we are going to make sure that any k belonging to <strong><em>P</em></strong> is separated enough from the next class by simply extracting <strong><em>P</em></strong>, <strong><em>Q</em></strong>, <strong><em>R</em></strong> from the aforementioned sequence [(<strong>A</strong>, <strong>A</strong>), (<strong>A</strong>, <strong>C</strong>)]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*FlsCsxsMNjhElKZl-AUXBg.png" /><figcaption>separation of the first class from the second one</figcaption></figure><p>For the first path <strong>p</strong>, we have established <strong>A</strong> -&gt; <strong>C</strong> -&gt; <strong>B</strong> -&gt; <strong>D</strong>, so the sequence of triplets will be:</p><p>T = [ [(<strong>A</strong>, <strong>A</strong>), (<strong>A</strong>, <strong>C</strong>)], [(<strong>A</strong>, <strong>C</strong>), (<strong>A</strong>, <strong>B</strong>)], [(<strong>A</strong>, <strong>B</strong>), (<strong>A</strong>, <strong>D</strong>)] ]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*1PqL1not4BeIYGdfNwVYtw.png" /></figure><p>The assumption is that with an increase of <strong>x</strong>, we will reach a value so that distance between any point between <strong>distance(tᵢ₁₁, tᵢ₁</strong>₂<strong>) &gt; distance(tᵢ</strong>₂<strong>₁, tᵢ</strong>₂₂<strong>)</strong>.</p><p>Now that we have obtained our <strong>set of sequences</strong>, to simplify the terms, we can name them as follows, being <strong>p </strong>the path, and <strong>i </strong>the element of its corresponding sequence:<br>Pₚ<strong>ᵢ</strong> = <strong>t</strong>ₚ<strong>ᵢ₁₁ = t</strong>ₚ<strong>ᵢ</strong>₂<strong>₁<br></strong>Qₚ<strong>ᵢ</strong> = <strong>t</strong>ₚ<strong>ᵢ₁</strong>₂<strong><br></strong>Rₚ<strong>ᵢ</strong> = <strong>t</strong>ₚ<strong>ᵢ</strong>₂₂</p><p>To make sure that in each path <strong>p</strong> constraint <strong>distance(</strong>Pₚ<strong>ᵢ, </strong>Qₚ<strong>ᵢ) &gt; distance(</strong>Pₚ<strong>ᵢ, </strong>Rₚ<strong>ᵢ) </strong>is met, we can iterate through every datapoint <strong>k ∈</strong> <strong><em>P</em></strong>:</p><ol><li>Apply a knn with respect to all the elements of <strong><em>Q</em></strong>, picking the last element in the list (the further one)</li><li>Apply a knn in respect to all the elements of <strong><em>R</em></strong>, picking the first element in the list (the closest one).</li><li>With an increase of <strong>x</strong>, because the distance between (<strong><em>P</em></strong>,<strong><em> Q</em></strong>) will increase at a faster rate than (<strong><em>P</em></strong>, <strong><em>R</em></strong>), there will be one value of <strong>x</strong> when the following condition will be met.</li></ol><h4><strong>Michelangiolo’s partial inequality</strong></h4><p>If we named the following inequality as its actual function, it would be troublesome to assign it a complete name. I will simplify it by calling it <strong>Michelangiolo’s partial inequality</strong>, in reference to the partial scalar multiplication applied to only the first concatenated vectors.</p><p>The following equation is computed for a given: <br><strong>k, Pₚᵢ, Qₚᵢ, Rₚᵢ </strong>where<strong> k, p ∈</strong> <strong>c</strong>ⱼ and <strong>v</strong> is the index of a vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eWn9h6fCq5djiKbxqQv9AA.png" /></figure><h4>Computing MSC given parameters</h4><p>After isolating the <strong>x </strong>(for the purpose of performing an immediate computation) from the <strong>MSC estimator</strong>, we obtain the following inequality:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrvyQ8dkl3Ab76uev_0IiQ.png" /></figure><p>Though exact, the domain of the function does not extend to the entire ℝ, as there are exceptions that may result in an <strong>undefined MSC</strong> (ex. when the distance between (P, Q) and (P, R) is identical, <strong>the inequality equation will never be met</strong>).</p><p>Because of the complexity of the problem, I will explain the use of the formula in different steps, reaching a formula to compute the SMC for a given k.</p><h4>Step 1: formula for a given k, path, and one element of the sequence</h4><p>If you look at the notebook in the repository, the algorithm has already computed all the MSC. As we can see, once we pick a sample <strong>k</strong> from our dataset, we need to make sure that all the neighbors in the surrounding classes will reach one class after the other.</p><p>Because we want x to be a real value respecting the above inequality, we will need to add a tiny value to the formula above. We can use the <strong>ε</strong> notation to complete the equation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VnItVuzcjodNf3tho18F4g.png" /></figure><p>In our example, if we apply a knn on the index 697 (k), by applying a partial scaling of our vectors by 0.604735, all its neighbors belonging to class 04 will be reached before the first k in class 06.</p><p>The same principle when applying a partial scaling of 5.647743, separating all neighbors from 06 to 04.</p><h4>Step 2: formula for a given k and path</h4><p>What is left to do is expanding the formula and apply it to the whole path 04. Because the P, Q, and R in the formula have been parameterized, we can use max to pick the biggest one in the current path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1mGeO_z6pxUEBLPD0Als6A.png" /></figure><p>The explanation for this formula is fairly simple. For the path starting from class 04, by applying a partial scaling of 35.496223 all classes have been separated from each other. The knn applied to k will reach the next class once all the neighbors of the previous class have been found.</p><h4>Final Step: final formula for a given k</h4><p>Finally, we can derive a final formula that account for all paths <strong>p</strong>. With the following formula, we can find the <strong>minimum scale coefficient</strong> of k applied on the entire dataset.</p><p>We can call this formula <strong>MSC estimator</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G9Af9oL2kttEuyOgMEocwA.png" /></figure><p>For a perfect <strong>vector split</strong> of the entire dataset, we just need to compute the MSC of all samples and <strong>pick the largest one</strong>.</p><h3>Controlling concatenation intensity</h3><p>We have stated how picking the largest MSC in our dataset lets us have a complete hierarchical separation, getting rid of all contaminations, when possible. We can count the number of contaminations by progressively increasing the scale multiplier (and visualizing it through a function):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkE4bKodxEnW56aMgxINIw.png" /><figcaption>number of contaminations in function of the scale multiplier used</figcaption></figure><p>By inverting the function, we can input the number of contaminations we are willing to tolerate in a merge (our way to control the intensity of the merge):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5VwbHfddAsKFk1r3-GLNQ.png" /><figcaption>relationship between maximum scale multiplier and the number of contaminations it causes</figcaption></figure><p>Once normalized the MSC value:</p><ul><li>When x=0, we will obtain a <strong>maximum level of contamination</strong></li><li>When x=1, we will obtain a <strong>minimum level of contamination</strong> <br> (I say minimum, and not 0, to account for all the x values that cannot be found in the domain of the <strong>inequality equation</strong>)</li></ul><p>By using this function, we can fully control the concatenation of two sets of vectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2DjgBbDlaRfsFeNmX3dqw.png" /><figcaption>obtaining the scale multiplier in function of the merge intensity</figcaption></figure><h3>Conclusion</h3><p>The original goal behind this research was to find the mathematical solution to perform a perfect vector split. However, as you can see from the results obtained from the visualization section, I understood that one of the main implications of this algorithm could be the control over the merging of multiple sets of vectors, allowing analysis that expand beyond a single set of features.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7ef9cc734d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/plain-simple-software/introducing-hierarchical-vector-concatenation-hvc-c7ef9cc734d3">Introducing Hierarchical Vector Concatenation (HVC)</a> was originally published in <a href="https://medium.com/plain-simple-software">Plain Simple Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>