<?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[Stories by _ptm on Medium]]></title>
        <description><![CDATA[Stories by _ptm on Medium]]></description>
        <link>https://medium.com/@_ptm?source=rss-81ef611c235a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4fiLlDfobqoqxgfRYBWFww.jpeg</url>
            <title>Stories by _ptm on Medium</title>
            <link>https://medium.com/@_ptm?source=rss-81ef611c235a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 15:26:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@_ptm/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When Agents Write the Code, What Do Engineers Own?]]></title>
            <link>https://medium.com/@_ptm/who-owns-the-software-when-agents-write-the-code-586315528675?source=rss-81ef611c235a------2</link>
            <guid isPermaLink="false">https://medium.com/p/586315528675</guid>
            <dc:creator><![CDATA[_ptm]]></dc:creator>
            <pubDate>Sat, 10 Oct 2026 19:59:49 GMT</pubDate>
            <atom:updated>2026-10-10T20:07:07.548Z</atom:updated>
            <content:encoded><![CDATA[<p>People are asking a reasonable question about software engineering in the age of AI: if agents can write the code, what does a software engineer own now? And if the work changes, what does success look like for an engineer?</p><p>There are a few answers making the rounds:</p><ul><li>Engineers will still own the code; agents will simply type it for them.</li><li>Engineers will own the agents, workflows, and specifications that guide code generation.</li><li>Freed from implementation, engineers will own the product itself: deciding what to build and taking responsibility for the whole thing.</li></ul><p>Each of these ideas contains something true. Each also leaves important questions unanswered. To see what might actually be changing, it helps to look at them one at a time — and then ask what software engineers have been doing all along.</p><h3>The engineer as code owner</h3><p>The first view is the most familiar: software engineers will continue to own the code. The only difference is that instead of typing it themselves, they will ask an agent to type it for them.</p><p>There is comfort in this picture. It says that the job stays fundamentally the same. The engineer remains responsible for the code, its quality, and its behavior. The tool that produces the code has changed, but the craft has not.</p><p>But saying that nothing has changed except who types the code underestimates what AI can do — and what happens when we use it at scale. As agents produce more code, the amount of code to understand and maintain grows. Testing can become unreliable. Changes can be difficult to make. Systems can become hard to extend. The code may work for the request in front of us while making the next request much harder.</p><p>An engineer can address those problems by slowing the agent down: constraining what it can do, reviewing every detail, and keeping its work inside the engineer’s own habits and understanding. Sometimes that restraint is necessary. But if the default answer is to use only a small part of the agents’ capabilities so that the work continues to look exactly as it did before, we should ask whether we are making good use of the technology.</p><p>There is also an economic pressure here. Imagine one team spending the afternoon carefully tuning a prompt to fix a null pointer exception, while another team — working with agents more freely — ships ten useful features by the same afternoon. That second team may have its own problems to solve, but the difference in pace will be hard to ignore. Since the Industrial Revolution, efficiency has been one of the central measures of success. A model of engineering that cannot improve it will be under pressure.</p><p>So engineers will still need to understand and take responsibility for code. But “the engineer owns the code, and the agent merely types” does not seem like a complete description of the job to come.</p><h3>The engineer as owner of agents and specifications</h3><p>A second view moves ownership up a level. Engineers will own the agentic orchestration: the tools, instructions, workflows, and specifications that agents use to produce software. This can mean at least two different things.</p><p>In the first version, every engineer creates and manages a customized set of tools and workflows. Development becomes, in large part, the work of tailoring those tools and writing the specifications that guide them.</p><p>That could be useful for a while. Different problems do need different approaches. But if every engineer independently builds tools that converge on the same — or nearly the same — instructions, a lot of effort is being repeated. That is rework multiplied across the organization. It is especially hard to imagine this being the steady state in a large enterprise. In many enterprises, the manager’s instinct is not simply to ask how to ship the product; it is also to decide how people and teams will be evaluated at the end of the year. Such an organization is unlikely to let everyone build a separate development system. More likely, one group will build the tools and the others will use them.</p><p>The second version is more interesting: perhaps engineers do not build their own tools, but they do write the specification, set up their environment, and let an agentic loop take care of the work. But what exactly does “write the specification” mean?</p><p>Does it mean writing a product-management spec: what the feature should do, what experience a customer should have, and how the system should implement it? If so, several questions follow:</p><ul><li>Does the engineer own every part of the spec? Who decides what belongs in it, and what makes it good or bad?</li><li>Who does the market and customer research that helps separate a real need from noise?</li><li>What is the engineer’s scope: one component, part of a feature, or the entire product?</li><li>If code generated from the specification is broken, behaves unexpectedly, or fails in production, who owns that outcome?</li></ul><p>It is easy to see why the specification becomes an attractive candidate for ownership. In the older division of work, different people owned different artifacts that eventually contributed to the product. A designer owned wireframes. A product manager owned requirements. An architect owned a design specification. A senior engineer might own the design and skeleton of the code, while a junior engineer owned components and implementation. If code is no longer the main input to a product, it is tempting to move the engineer upward and say: perhaps the engineer should own the artifact that produces the code instead.</p><p>That idea assumes the specification will be a stable, complete artifact — good enough to generate the product. The history of software development gives us a reason to be cautious about that assumption.</p><p>We once spent a great deal of time planning before implementation. Waterfall methods tried to work out the plan and design up front, before building. But no plan could perfectly predict the product we would want after we saw it working. Expectations drifted. What we built differed from what we had imagined. We needed to iterate.</p><p>Because planning was costly, teams began looking for ways to get a first version in front of people sooner, gather feedback, and adjust. Agile methods made that cycle more practical: build a draft early, review it, learn, and iterate. The point was not that planning had no value. It was that a plan made in advance could not replace learning from the thing we had built.</p><p>Now the cost of development is falling again. That changes the question. Maybe we should plan carefully and then generate. But maybe, for some problems, it is cheaper to try several approaches and choose the one that works best. I expect the rhythm to remain iterative — agile, in that broad sense — but with faster cycles and more things we can afford to try.</p><p>If that is right, then specifications and other artifacts will evolve as we build. Agents will help us change them, just as they help us change code. These artifacts still matter, but they may not be permanent objects that one person owns from beginning to end. They may be part of an ongoing process of making, observing, and revising.</p><h3>The engineer as product owner</h3><p>The third view says that if engineers are no longer occupied by implementation, they can take ownership of the product. They can come up with the ideas, decide what should be built, and take responsibility for the whole experience — not just explain how and why, but decide what.</p><p>This argument can be shaped by the environment it comes from. In a large enterprise, there may be many people in product and engineering, and enough resources to divide authority neatly: one group says what to build, another says how. These organizations can afford to treat the boundary between product and engineering as a settled arrangement. They can also end up producing incremental features and redundant products, with teams doing their assigned part while no one feels real ownership of the result.</p><p>The question of who decides what gets built is not just a question of job titles. When product and engineering are far apart, engineers can end up doing their duty without feeling that they own the product. Where ownership is shared, and product and engineering have a real resonance with each other, the result can be a much better product. Engineers bring a view of what is possible and what will be costly; product people bring a view of customers, markets, and priorities. Neither perspective is enough on its own.</p><p>There is also a more expansive version of this argument: engineers will do everything, from product requirements through implementation. They will research the market, talk to customers, design the solution, and build it. That possibility has weight, especially when agents can help with work that used to take whole teams. But it raises difficult questions:</p><ul><li>Will engineers need to acquire all these skills, or will they rely on agents for product and market research?</li><li>How will they guard against a familiar bias: choosing something technically complex because it is interesting to build, rather than something useful to customers?</li><li>Who decides whether to pay down technical debt or deliver a new feature, and who advocates for each?</li><li>Who forms the product hypothesis, on what evidence, and who decides what belongs in the product?</li><li>What does failure mean in this model? Does failure disappear, or does it simply become harder to recognize?</li><li>How much customer and market research is enough?</li><li>When a customer’s request conflicts with a problem in the engineering pipeline, who decides which deserves attention first?</li></ul><p>Beneath these questions is a real body of expertise. Product management is not only about deciding the alignment of a button or the localization of a string. Those details can often be handled without a product opinion at every step. But teams still need people who can ask what matters, understand the likely return on an investment, and decide when to prioritize a customer, a feature, or something else. If engineers take on more product responsibility, the organization still has to answer where that expertise comes from and how those decisions get made.</p><p>The product-owner model can expand an engineer’s role, but it cannot make the hard decisions go away just by moving them to engineering.</p><h3>The engineer as supervisor of a software factory</h3><p>All three views point to a deeper change. Software engineers used to be the people producing software. They were the factory. Now agents are becoming the software factory.</p><p>Think of agents as the machines and robots in a manufacturing plant, and agentic workflows as the production lines that connect them. The engineer’s role begins to look less like operating one machine by hand and more like supervising the factory: making sure the process runs, checking the quality of what comes out, setting up reliable procedures, auditing the results, and troubleshooting when something goes wrong.</p><p>This does not mean that engineers own the factory itself — the machines or every component in them. They may build some in-house components or create custom pipelines, but the deeper responsibility is to own the process of software manufacturing: how the work moves through the system and whether the system can produce a good result consistently.</p><p>A fair question follows: if this is just a factory where agents have replaced human workers, why do we need software engineers? Couldn’t managers take over? Managers already manage software teams. Perhaps they can give agents the same instructions they gave people.</p><p>There is a part of that argument that is right. Managers will have a role. But managing people and supervising a production system are not the same job. Many managers are experienced at managing people: organizing teams, setting expectations, offering rewards, imposing consequences, or restructuring the group. Those tools may affect people’s behavior. They do not tell you whether a software factory is producing sound work, whether its process is inefficient, or which part of the process is causing the problem.</p><p>Giving instructions is not the same as knowing what good looks like. A manager may have given instructions to a team without being the person who could evaluate the quality of the underlying system. In an agent-based factory, the gap becomes more visible. The system needs someone who can tell signal from noise, judge the output, and work out whether the problem lies in the process, the instructions, or the inputs. A manager’s influence or confidence cannot stand in for that understanding; neither can a defensive attachment to a past opinion.</p><p>The factory needs supervision close to the work. Someone has to think about efficiency, effectiveness, consistency, and accuracy. They need to understand the fundamentals and the parts of the system well enough to distinguish a healthy process from a flawed one, audit what it produces, and know which settings to adjust. They need to know what information the factory should receive and in what form. If work is piling up in a queue, they need to understand where it is stuck and how to clear it.</p><p>That can sound abstract, so consider what the software itself may become. We are likely to see more personalization in products and experiences, which changes how people interact with software. More workflows will be nondeterministic: the system may not take the exact same path every time. Software may carry out delegated actions on a user’s behalf, making permissions and access more consequential. And when systems act in ways that are difficult to predict, rolling them back may not be as simple as reverting a line of code.</p><p>Each change creates concrete engineering questions:</p><ul><li><strong>Personalization:</strong> How do we deploy and maintain software that is personalized for each user? What does that user’s upgrade path look like, and how do we manage the software over its lifecycle?</li><li><strong>Nondeterminism:</strong> How do we know a feature is still providing useful value when it may not behave exactly the same way every time? At what point is it safe to ship, and what should its evaluation process look like?</li><li><strong>Delegated actions:</strong> How should actions taken on a user’s behalf work, and what access should a system have?</li><li><strong>Recovery:</strong> If something goes wrong, how do we return to the last good state?</li></ul><p>We will also have to decide which parts of a system can be probabilistic and which must remain deterministic. The factory itself may be nondeterministic, too: agents could spend one feature adding a change, the next reverting it, and the next bringing it back again. Someone has to notice that cycle and work out whether the issue is in the pipeline, the instructions, the inputs, or the settings. Then they need to check that the factory’s output can still be deployed and maintained. They have to decide:</p><ul><li>Which evaluations should run, and what should they measure?</li><li>Is the problem in the pipeline, or in the settings or input given to it?</li><li>Which adjustment is likely to fix the issue without creating another one?</li></ul><p>Could agents supervise all of this, too? Some teams will certainly try. There are plausible limits, though:</p><ul><li>Software released to the public will face compliance requirements, and some decisions may need to remain under human control.</li><li>People will still need to define what is being built and what product the system is meant to be.</li><li>The production system itself will be technically complex and will need people who can understand, evaluate, and adjust it.</li></ul><p>Taken together, these responsibilities suggest that the need for engineers does not disappear. It changes shape.</p><p>The question, then, may not be whether software engineers will own code, specifications, or products. Engineers may work across all three, alongside product managers, designers, and other specialists. The more important shift is that these artifacts may no longer define engineering ownership by themselves. As agents take on more of the production work, a central engineering responsibility will be to supervise the system that produces software: to understand its behavior, evaluate its output, and keep the whole process useful, dependable, and safe to change.</p><p>The machines may write the code. Someone still has to know whether the factory is making the right thing — and whether it is making it well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=586315528675" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future of Software: Welcome to the Software Factory]]></title>
            <link>https://medium.com/@_ptm/the-future-of-software-welcome-to-the-software-factory-a2c100b41dd1?source=rss-81ef611c235a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2c100b41dd1</guid>
            <dc:creator><![CDATA[_ptm]]></dc:creator>
            <pubDate>Wed, 04 Feb 2026 13:56:47 GMT</pubDate>
            <atom:updated>2026-02-04T13:56:47.740Z</atom:updated>
            <content:encoded><![CDATA[<p>The software industry is currently experiencing what can only be described as a coordinated panic attack.</p><p>Every time a new model drops, half of <strong>X</strong> announces that programming is officially dead, while the other half insists this is just autocomplete with confidence issues. Both groups are extremely sure. Neither is particularly calm.</p><p>As a developer, I naturally have opinions. This is not because I am wise, but because I have rent to pay and would prefer to keep doing so.</p><p>What follows is an attempt to outline what is likely to happen, how roles will evolve, and why some people are reasonably safe — while others may want to quietly open LinkedIn and pretend, they’re “just browsing.”</p><p>Before speculating irresponsibly on my own, let’s first examine the predictions of people whose net worth gives their guesses an air of inevitability.</p><h3>The Billionaire Bingo Card</h3><p>Everyone has a prediction. This is the modern equivalent of astrology, except with more <strong>GPUs</strong>.</p><ul><li><strong>Elon Musk:</strong> “AI will do everything. Humans are basically house cats.”</li><li><strong>Jensen Huang (Nvidia):</strong> “It is our job to create computing technology such that nobody has to program. The programming language of the future is human.”</li><li><strong>Satya Nadella:</strong> “AI won’t replace you; a human using AI will replace you.” (The corporate version of “Get good or get out.”)</li><li><strong>Sam Altman:</strong> “One engineer will do the work of ten.” (Great for the one engineer; bad for the other nine playing ping-pong in the breakroom.)</li></ul><p>Since predicting the future is free, let’s take a random guess on the spectrum and justify it with extreme confidence.</p><h3>1. “But my legacy code is too complex for AI!” (The Denial Phase)</h3><p><strong>The argument:</strong><br> “AI can write scripts, sure. But it can’t touch <em>my</em> codebase. This is a 15-year-old monolith written in Java 6, held together by duct tape, undocumented conventions, and the fading memory of someone named Dave who retired in 2019. An AI would hallucinate just opening the repo.”</p><p><strong>The reality check:</strong><br> If this sounds familiar, congratulations — you are not defending job security. You are describing a hostage situation.</p><p>If your company “can’t use AI” because the codebase is an archaeological site, that is not a competitive advantage. That is a future incident report.</p><p>Here is the uncomfortable truth, including for me and people like me: <strong>automation is not a personal attack; it is basic economics.</strong></p><p>If Company A insists on artisanal, hand-crafted software where senior engineers spend three weeks discovering why a variable is null, while Company B uses AI agents to rebuild the same feature in four hours at one-hundredth the cost, Company A does not get a medal for effort. It gets outcompeted.</p><p>Nobody is paying extra for your suffering. Not even your manager, despite what performance reviews may imply.</p><h3>2. The Industrial Revolution of Code: Welcome to the Software Factory</h3><p>To understand where we are going, look at where construction and manufacturing went during industrial revolution.</p><p>Before the industrial revolution, manufacturing was “artisanal.” You had a craftsman who did everything — designing, building, polishing, and fixing. That is exactly where software is today. We are artisans, hand-crafting loops and manually centering divs.</p><p>Then came automation and machines. Did engineers disappear? No. But their role split into two very different paths. We are now entering the <strong>Software Factory</strong> era, and you will likely fall into one of these two buckets:</p><p><strong>A. The Tool Makers</strong></p><p>These are the people inventing the new automation tools, creating the AI models, and doing the deep research. In the factory analogy, these are the people designing the robots.</p><p><strong>B. The “Plant Manager” (The New Full Stack)</strong></p><p>In construction and manufacturing, the Project Engineer doesn’t manually tighten bolts anymore. They:</p><ol><li><strong>Design the Process:</strong> They create the plan and the Gantt chart.</li><li><strong>Manage the Machines:</strong> They configure the automation to do the heavy lifting.</li><li><strong>Handle Stakeholders:</strong> They talk to the business, the R&amp;D team, and the component owners.</li><li><strong>Fix the Line:</strong> Crucially, when the machine jams or the robot arm tears a door off a car, the Project Engineer rolls up their sleeves, goes to the plant floor, and gets their hands dirty to fix it.</li></ol><p><strong>This is the future Software Engineer.</strong></p><p>You aren’t a “Coder” anymore. You are a <strong>Component Owner</strong>.</p><ul><li><strong>Old Role:</strong> Spend 3 days writing a login function.</li><li><strong>New Role:</strong> Orchestrate a swarm of AI agents to build the login, database, and frontend in 3 hours. Review their work. Deploy.</li><li><strong>The Catch:</strong> When the agent hallucinates and brings down the production database, you must have the deep technical skills to dive into the code and fix it manually. You manage the factory, but you must know how to repair the machines.</li></ul><h3>3. The Team Structure: The Great Flattening</h3><p>In a factory, you don’t need ten people staring at a robot.<br> You need one skilled operator — not to stare, obviously, but to observe, intervene, and operate when necessary.</p><p>The traditional, bloated org chart is going to collapse.</p><p><strong>Current State:</strong></p><p>We currently have hierarchies that look like pyramids: Engineers Managers Directors, surrounded by clouds of Architects and PMs.</p><p><strong>Future State:</strong></p><p>Teams will shape around <strong>Component Ownership</strong>.</p><p>We won’t need massive teams to maintain a service. We will need one <strong>Component Owner</strong> (The Plant Manager) and perhaps a few lower-skilled operators (diploma-level staff versed in AI tools) to handle the routine monitoring.</p><p><strong>The Fate of Architects and Middle Managers:</strong></p><p>Right now, we often separate “Thinking” (Architects) from “Managing” (Middle Managers).</p><ul><li><strong>Middle Managers:</strong> Manage people/schedules but haven’t coded in years.</li><li><strong>Architects:</strong> Draw boxes but don’t manage execution.</li></ul><p><strong>These roles will merge.</strong></p><p>In the Software Factory, you cannot separate strategy from execution. We don’t need a manager who can’t debug the factory line, and we don’t need an architect who can’t manage the schedule. Most likely, <strong>Architects will absorb the Middle Manager role</strong> because technical depth is the prerequisite for running the factory.</p><h3>4. The Engineer vs. PM: Why Engineers Win the Cage Match</h3><p>Now, let’s talk about Product Managers (PMs).</p><p>Currently, the PM defines the “What” and the Engineer defines the “How.”</p><p>But as AI handles the “How” (the coding), the Engineer has freed up brain cycles. Naturally, they will start looking upstream at the “What.”</p><p><strong>The Harsh Truth:</strong></p><p>The convergence flows one way.</p><ul><li><strong>Engineer to Product Owner:</strong> An engineer learning user empathy and business logic is a natural evolution. They already know the physics of the factory.</li><li><strong>PM to Component Owner:</strong> A non-technical PM trying to learn how to debug a distributed system race condition? That is a much steeper mountain.</li></ul><p>It’s not that PMs are obsolete; it’s that the <strong>technical floor is rising</strong>. You can’t “project manage” your way out of a factory fire. You have to know which valve to turn. Engineers are simply better positioned to hold the keys to the factory.</p><h3>5. SaaS isn’t Dead, But “Deterministic” Code might be a Luxury</h3><p>SaaS isn’t going anywhere. But the way we build it is changing from <strong>Deterministic</strong> (If X then Y) to <strong>Probabilistic</strong> (If X, then maybe Y, or maybe a poem about Y).</p><ul><li><strong>Deterministic Code:</strong> Reliable, consistent, boring. 200 OK.</li><li><strong>Agentic Code:</strong> “I tried to fulfill your request, but I got distracted.”</li></ul><p>We are moving to a world where “Software Reliability” becomes “Software Tolerance.”</p><p>Designers and Developers will face a new choice:</p><ul><li><strong>Option A:</strong> Write deterministic code (expensive, takes time, actually works every time).</li><li><strong>Option B:</strong> Use an Agent (cheap, fast, works 95% of the time, occasionally lies to the user).</li></ul><p>The “Everything is an Agent” crowd forgets that sometimes, you just want a calculator to be a calculator, not a “creative math assistant.”</p><h3>6. What I’d Focus On If I Were Entering the Factory Today</h3><p>If you’re a student or just starting out, there’s a good chance you’re currently experiencing a low-grade, background anxiety.</p><p>Something along the lines of: <em>“If the factory robots are doing the work now, what exactly am I supposed to learn?”</em></p><p>This is a reasonable concern. I had a similar panic years ago, except back then the “robots” were frameworks, and we all agreed — very confidently — that picking the right one would secure our careers. Many of us picked. Some of us were right. We now tell that story as if it were foresight.</p><p>If I were starting today, I probably wouldn’t optimize for becoming a “C# Developer” or a “React Developer.” Not because those skills are bad — they pay bills — but because they’re increasingly the equivalent of learning how to tighten a very specific bolt on a very specific machine.</p><p>Valuable work. Until the machine is replaced. Which it always is, usually on a Tuesday.</p><p>What I’d try to focus on instead looks less impressive on a resume, but tends to survive longer than any particular stack.</p><p><strong>System thinking.</strong><br> I’d spend time understanding how the whole factory works. How services talk to each other, how data flows, and where it quietly goes to die. AI is excellent at writing a function. It is noticeably less competent at understanding why the function exists or how it fits into the larger system. That gap is where humans still justify their presence.</p><p><strong>Computer science fundamentals.</strong><br> When the robot breaks — and it will — you need more than confidence and a Slack thread. Knowing operating systems, data structures, and basic distributed systems turns “everything is broken” into “I know where to look first.” I learned this mostly after incidents, which is not the recommended order.</p><p><strong>Product design and empathy.</strong><br> If AI is handling a good chunk of the syntax wrestling, that frees up time. Ideally, that time goes toward making sure the thing you’re building actually helps someone. Computers are already very good at being computers. They still struggle with people.</p><p><strong>Collaboration.</strong><br> Like it or not, you will talk less to compilers and more to humans — designers, PMs, customers, and occasionally someone extremely unhappy about latency. Clear communication and the ability to navigate ambiguity turn out to be real technical skills, even if nobody puts them in a requirements doc.</p><p>And a brief disclaimer, because honesty is cheaper than confidence:</p><p>Everything above is filtered through survivorship bias. I’m describing what <em>seems</em> durable from the perspective of someone who didn’t get filtered out. That alone should make you skeptical. Most career advice sounds obvious in retrospect and questionable in advance. This is no exception.</p><h3>Summary</h3><p>The software industry isn’t dying; it is industrializing.</p><p>We are moving from the Artisan Era to the <strong>Software Factory Era</strong>.</p><ul><li><strong>To the Managers:</strong> Get technical again. You can’t manage a factory if you don’t know how the machines work.</li><li><strong>To the PMs:</strong> Get technical or get very strategic. The middle ground is disappearing.</li><li><strong>To the Engineers:</strong> Stop identifying as a “Coder” (Artisan) and start identifying as a “Component Owner” (Plant Manager).</li></ul><p>Good luck. And seriously, if you are holding stock in a company that “doesn’t believe in AI” — sell.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2c100b41dd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Product Quantization for Efficient Vector Database Indexing]]></title>
            <link>https://medium.com/@_ptm/exploring-product-quantization-for-efficient-vector-database-indexing-5a3cba351f5d?source=rss-81ef611c235a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a3cba351f5d</guid>
            <dc:creator><![CDATA[_ptm]]></dc:creator>
            <pubDate>Sat, 10 Feb 2024 19:02:20 GMT</pubDate>
            <atom:updated>2024-02-10T19:39:00.374Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of high-dimensional data analysis, managing and querying large-scale datasets efficiently is crucial for various applications such as image retrieval, recommendation systems, and natural language processing. Product Quantization (PQ) is a powerful technique used in vector databases to address the challenges of high dimensionality and large-scale datasets while maintaining retrieval accuracy and efficiency.</p><p>In this blog post, we’ll delve deeper into the concept of Product Quantization, its implementation in vector databases like Faiss, and its implications for storage and indexing efficiency.</p><h3>What is Product Quantization?</h3><p>Product Quantization is a quantization technique used to reduce the dimensionality and memory requirements of high-dimensional vectors while preserving their essential characteristics. It involves dividing the vector space into subspaces and quantizing each subspace independently.</p><p>To understand how Product Quantization works, let’s first look at some mathematical formulas. Suppose we have a high-dimensional vector 𝑥 of dimension 𝐷. We can decompose 𝑥 into 𝑀 sub-vectors 𝑥ᵢ, each of dimension 𝐷/𝑀:</p><p>𝑥 = [𝑥₁, 𝑥₂, …, 𝑥ₘ]</p><p>For each subspace 𝑖, we can compute a set of representative points, called subcentroids, denoted by 𝐶ᵢ. The subcentroids form a codebook that contains 𝐾 possible values for each sub-vector:</p><p>𝐶ᵢ = {𝑐ᵢ₁, 𝑐ᵢ₂, …, 𝑐ᵢₖ}</p><p>The quantization process consists of assigning each sub-vector 𝑥ᵢ to its nearest subcentroid 𝑐ᵢⱼ, using the Euclidean distance as the similarity measure. This results in a compressed representation of 𝑥, denoted by 𝑞(𝑥), that consists of 𝑀 indices, each corresponding to a subcentroid:</p><p>𝑞(𝑥ᵢ) = argmin𝑐ᵢⱼ∈𝐶ᵢ‖𝑥ᵢ − 𝑐ᵢⱼ‖² 𝑞(𝑥) = [𝑞(𝑥₁), 𝑞(𝑥₂), …, 𝑞(𝑥ₘ)]</p><p>The quantized representation 𝑞(𝑥) can be stored using fewer bits than the original vector 𝑥, as each index can be encoded using log(𝐾) bits. For example, if we have a 128-dimensional vector and we divide it into 8 subspaces of 16 dimensions each, and we use 256 subcentroids per subspace, we can store the quantized vector using 64 bits, instead of 4096 bits.</p><p>The quantization process also allows us to approximate the distance between two original vectors 𝑥 and 𝑦 by using the distance between their quantized representations 𝑞(𝑥) and 𝑞(𝑦). The distance approximation can be computed as the sum of the distances between the corresponding sub-vectors:</p><p>𝑑(𝑥, 𝑦) ≈ 𝑑′(𝑥, 𝑦) = ∑ᵢ₌₁ᴹ‖𝑞(𝑥ᵢ) − 𝑞(𝑦ᵢ)‖²</p><p>The distance approximation can be used to perform fast similarity search operations, such as finding the nearest neighbors of a query vector, by using the quantized vectors instead of the original vectors.</p><h3>Implementation in Faiss</h3><p>Faiss, a library developed by Facebook for efficient similarity search and clustering of dense vectors, supports Product Quantization for indexing high-dimensional vectors. Product Quantization can be easily implemented in Faiss by specifying parameters such as the number of subquantizers, subcentroids per subspace, and bits per sub-vector.</p><p>For detailed implementation examples and documentation, you can refer to the official Faiss documentation: <a href="https://faiss.ai/">Faiss Documentation</a>.</p><p>Faiss also provides a composite index that combines an inverted file system (IVF) with Product Quantization (PQ). This index allows for faster and more accurate search by partitioning the vector space into coarse clusters and applying Product Quantization within each cluster. The IVF+PQ index can speed up the search by 92x compared to non-quantized indexes, according to this article: <a href="https://www.pinecone.io/learn/series/faiss/product-quantization/">Product Quantization: Compressing high-dimensional vectors by 97%</a>.</p><h3>Benefits of Product Quantization</h3><p>Product Quantization offers several benefits for efficiently managing high-dimensional data in vector databases, such as:</p><ul><li><strong>Reduced Memory Requirements</strong>: Quantized representations occupy less memory compared to original vectors, leading to efficient storage.</li><li><strong>Faster Similarity Searches</strong>: Efficient indexing and retrieval mechanisms enable faster similarity search operations, even on large-scale datasets.</li><li><strong>Preserved Retrieval Accuracy</strong>: Product Quantization preserves the essential characteristics of the original vectors and provides a good approximation of the distance between them, resulting in high retrieval accuracy.</li></ul><h3>Real-world Applications</h3><p>Product Quantization finds applications in various domains, including image retrieval, recommendation systems, and natural language processing. By enabling efficient storage and retrieval of high-dimensional vectors, it facilitates faster and more effective data analysis and processing.</p><p>Some examples of Product Quantization applied to different domains are:</p><ul><li><strong>Image Retrieval</strong>: Product Quantization can be used to compress and index image features, such as SIFT or CNN descriptors, and perform fast and accurate image retrieval. For example, this paper proposes a novel neural network architecture that integrates Product Quantization as a layer, allowing end-to-end learning of a discriminative and compact image representation: <a href="https://link.springer.com/article/10.1007/s11263-020-01326-x">Product Quantization Network for Fast Visual Search</a>.</li><li><strong>Recommendation Systems</strong>: Product Quantization can be used to reduce the dimensionality and storage of user and item embeddings, and perform fast and personalized recommendations. For example, this paper presents a scalable and efficient recommendation system that leverages Product Quantization to compress and index user and item embeddings: <a href="https://link.springer.com/content/pdf/10.1007/s11263-020-01326-x.pdf">Efficient Recommendation System with Product Quantization</a>.</li><li><strong>Natural Language Processing</strong>: Product Quantization can be used to improve the retrieval performance for ad-hoc queries, such as question answering or document retrieval. For example, this paper presents a matching-oriented Product Quantization method that aims to improve the retrieval performance for ad-hoc queries. It leverages the query information to adapt the quantization process and the distance computation, resulting in more accurate and efficient matching: <a href="https://aclanthology.org/2021.emnlp-main.640/">Matching-oriented Product Quantization For Ad-hoc Retrieval</a>. This paper proposes an end-to-end supervised Product Quantization method that learns the optimal quantization parameters from the data. It uses a deep neural network to learn the subspace division and the subcentroids simultaneously, and a triplet loss to optimize the retrieval accuracy: <a href="https://aclanthology.org/2022.emnlp-main.54/">End-to-End Supervised Product Quantization for Image Retrieval</a>. This article provides an overview of how Product Quantization can be used to compress and accelerate large language models, such as BERT, for efficient natural language processing: <a href="https://medium.com/@Kumar_Gautam/quantization-unleashing-the-power-of-large-language-models-a4e57763eab1">Quantization: Unleashing the Power of Large Language Models</a>.</li></ul><h3>Conclusion</h3><p>Product Quantization is a valuable technique for efficiently managing high-dimensional data in vector databases. Its implementation in libraries like Faiss empowers researchers and practitioners to handle large-scale datasets effectively while maintaining retrieval accuracy and efficiency.</p><p>As the volume and dimensionality of data continue to grow, techniques like Product Quantization will play an increasingly important role in enabling efficient data management and analysis across various domains.</p><p>Through this blog post, we’ve explored the fundamentals of Product Quantization and its significance in high-dimensional data analysis. By incorporating Product Quantization into vector database systems, researchers and practitioners can unlock new possibilities for efficient data management and analysis.</p><p>For further reading and exploration, you can refer to the following links and references:</p><ul><li><a href="https://faiss.ai/">Faiss Documentation</a>: The official documentation of Faiss, a library for efficient similarity search and clustering of dense vectors. It supports various indexing and quantization methods, including Product Quantization.</li><li><a href="https://www.pinecone.io/learn/series/faiss/product-quantization/">Product Quantization: Compressing high-dimensional vectors by 97%</a>: This article provides a comprehensive introduction to Product Quantization and its advantages over other quantization methods. It also shows how to implement Product Quantization in Faiss and how to use a composite IVF+PQ index to speed up the search by 92x compared to non-quantized indexes.</li><li><a href="https://link.springer.com/article/10.1007/s11263-020-01326-x">Product Quantization Network for Fast Visual Search</a>: This paper proposes a novel neural network architecture that integrates Product Quantization as a layer, allowing end-to-end learning of a discriminative and compact image representation. It also introduces an asymmetric triplet loss to optimize the retrieval accuracy based on asymmetric similarity measurement. The experiments demonstrate the state-of-the-art performance of the proposed method in fast image retrieval.</li><li><a href="https://arxiv.org/abs/2104.07858">Matching-oriented Product Quantization For Ad-hoc Retrieval</a>: This paper presents a matching-oriented Product Quantization method that aims to improve the retrieval performance for ad-hoc queries. It leverages the query information to adapt the quantization process and the distance computation, resulting in more accurate and efficient matching. The experiments show that the proposed method outperforms the existing Product Quantization methods on several benchmark datasets.</li><li><a href="https://arxiv.org/abs/1711.08589v2">End-to-End Supervised Product Quantization for Image Retrieval</a>: This paper presents an end-to-end supervised Product Quantization method that learns the optimal quantization parameters from the data. It uses a deep neural network to learn the subspace division and the subcentroids simultaneously, and a triplet loss to optimize the retrieval accuracy. The experiments show that the proposed method achieves superior performance over unsupervised Product Quantization methods on several image retrieval datasets.</li><li><a href="https://link.springer.com/article/10.1007/s11042-023-17564-3">Flexible product quantization for fast approximate nearest neighbor search</a>: This paper presents a flexible Product Quantization method that allows for dynamic adjustment of the number of subspaces and the number of subcentroids per subspace. It uses a hierarchical clustering algorithm to construct the codebooks and a greedy algorithm to assign the sub-vectors to the subcentroids. The experiments show that the proposed method can achieve better trade-offs between accuracy and efficiency than fixed Product Quantization methods.</li></ul><p>Note: This blog post was written with the assistance of Microsoft Copilot and ChatGPT.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a3cba351f5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>