<?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[HTX DSAI - Medium]]></title>
        <description><![CDATA[Data Science and Artificial Intelligence, HTX - Medium]]></description>
        <link>https://medium.com/htx-dsai?source=rss----4624f6c96b9f---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>HTX DSAI - Medium</title>
            <link>https://medium.com/htx-dsai?source=rss----4624f6c96b9f---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:29:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/htx-dsai" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Photos to Playable Mesh: A Technical Primer on Modern 3D Scene Reconstruction]]></title>
            <link>https://medium.com/htx-dsai/from-photos-to-playable-mesh-a-technical-primer-on-modern-3d-scene-reconstruction-ac5d3fa59a33?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/ac5d3fa59a33</guid>
            <category><![CDATA[structure-from-motion]]></category>
            <category><![CDATA[gaussian-splatting]]></category>
            <category><![CDATA[3d-reconstruction]]></category>
            <category><![CDATA[neural-rendering]]></category>
            <dc:creator><![CDATA[Adrian Law]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 06:20:04 GMT</pubDate>
            <atom:updated>2026-09-02T06:20:03.683Z</atom:updated>
            <content:encoded><![CDATA[<h4>How structure-from-motion and mesh-based Gaussian splatting turn an ordinary folder of photos into a real-time, exportable 3D scene</h4><p>Turning a set of ordinary photos into a navigable 3D scene has gone from a research curiosity to something achievable on consumer hardware. Two distinct problems have to be solved along the way, and they are solved by two very different families of techniques:</p><ol><li><strong>Recovering the cameras.</strong> Figuring out where the camera was standing for every photo, and roughly what the space looks like.</li><li><strong>Rendering the scene. </strong>Turning that rough structure into something that renders quickly and looks convincing from angles no photo ever captured.</li></ol><p>This post is a technical walkthrough of both halves. <strong>COLMAP</strong> is the standard tool for the first problem. The second problem takes the rest of the post: a primer on <strong>Gaussian Splatting</strong>, the technique that made real-time rendering from photos look easy, then why its output falls short for most practical pipelines, and finally a 2026 method called <strong>MeshSplatting</strong> that addresses that gap.</p><h3>COLMAP: Recovering Structure from Photos</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*isFsaGmrnQoe_KuVkH56Ig.png" /><figcaption>A sparse model of Central Rome produced by COLMAP from 21,000 images.</figcaption></figure><p>Before any scene optimisation can start, something has to answer a more basic question: where was the camera standing for each photo, and what is the rough 3D shape of the space?</p><p>That is what <a href="https://colmap.github.io/"><strong>COLMAP</strong></a><strong> </strong>does. It is an open-source Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline, and it has become close to the default choice for this step in both academic 3D vision work and applied photogrammetry. Given a set of photos of the same scene, the pipeline works in four stages:</p><ol><li><strong>Feature extraction.</strong> Distinctive visual features are pulled from every image: corners, textured regions, anything recognizable across multiple photos. This typically uses <a href="https://en.wikipedia.org/wiki/Scale-invariant_feature_transform">SIFT</a> descriptors.</li><li><strong>Feature matching.</strong> Those features are compared across image pairs to figure out which photos overlap and see the same physical points.</li><li><strong>Incremental reconstruction.</strong> Starting from a well-matched image pair, the pipeline registers additional images one at a time, solving for each camera’s position and orientation. To keep errors from accumulating as more images join, it periodically runs <em>bundle adjustment</em>, a nonlinear least-squares optimisation that jointly refines every camera pose and every 3D point to minimize the total reprojection error across the whole reconstruction.</li><li><strong>Dense reconstruction (optional).</strong> Beyond the sparse point cloud, a multi-view stereo stage using <em>patch-match stereo </em>can densify the result into a much thicker point cloud or a full surface mesh, at higher computational cost.</li></ol><h4>Why has COLMAP become the standard starting point? A few reasons:</h4><ul><li><strong>Accuracy.</strong> Reconstructions with good photo coverage routinely achieve sub-pixel mean reprojection error.</li><li><strong>Scale.</strong> With GPU-accelerated feature matching, it has been used on datasets running into the thousands of images.</li><li><strong>Cost.</strong> It is free and open source.</li></ul><p>That is why almost every downstream method, whether <a href="https://en.wikipedia.org/wiki/Neural_radiance_field">NeRF</a>, Gaussian Splatting, or newer mesh-based methods like MeshSplatting, builds directly on top of it rather than reinventing this step. The techniques in the rest of this post start from exactly two of COLMAP’s outputs: the recovered camera poses and the sparse point cloud.</p><p>With cameras and rough structure in hand, the first problem is solved. The second problem, rendering the scene convincingly from new angles in real time, is where the story picks up in 2023.</p><h3>Rendering the Scene, Take One: Gaussian Splatting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqYQOAKtLOWpBTdCR8ojOA.png" /><figcaption>A construction site captured with 3D Gaussian Splatting. The softness and semi-transparency around the ceiling and window frames come from the blob-cloud representation itself.</figcaption></figure><p>In 2023, a paper by Kerbl, Kopanas, Leimkühler, and Drettakis introduced <strong>3D Gaussian Splatting</strong>, and it resets expectations for what real-time 3D from photos should look like.</p><p>Rather than a traditional mesh (flat triangular faces stitched edge to edge, the way a low-poly video game model is built), a scene is represented as a large number of small, soft, translucent blobs floating in space. Each blob carries four things:</p><ol><li><strong>Position</strong> in space.</li><li>A <strong>size</strong> and <strong>stretch direction</strong>.</li><li>A <strong>colour</strong>.</li><li>A <strong>transparency </strong>value.</li></ol><p>None of these blobs mean anything individually. What makes the technique work is training:</p><ol><li>Start with a rough scattering of blobs, conveniently initialised from the sparse point cloud COLMAP already produced in the previous step.</li><li>Render what the blobs would look like from the same angles as the real photos (angles COLMAP also recovered).</li><li>Compare against the originals, and nudge every blob’s position, shape, and colour slightly closer.</li><li>Repeat tens of thousands of times.</li></ol><p>Two details matter beyond that basic picture:</p><ol><li><strong>View-dependent colour.</strong> Each blob’s colour is not fixed. It is represented with <em>spherical harmonics</em>, a compact way of encoding how a surface’s apparent colour shifts depending on viewing angle. That is what lets the technique reproduce reflections and other view-dependent lighting effects rather than looking flat from every direction.</li><li><strong>A blob count that is not fixed.</strong> The blob population changes size during training. An <em>adaptive density control </em>step periodically splits blobs that are stretched too thin to represent fine detail, and prunes ones that contribute almost nothing to the final image. The scene’s complexity grows and shrinks automatically as training progresses.</li></ol><p>Rendering a pile of soft, alpha-blended blobs is comparatively simple math. There is no ray marching through a neural network, unlike the NeRF-based methods that came before it, so this runs genuinely fast. The original paper reported:</p><ul><li>Real-time novel-view rendering at <strong>100+ frames per second </strong>at 1080p.</li><li>Full training completed in well <strong>under an hour </strong>on a single high-end GPU.</li></ul><p>For comparison, the highest-quality prior NeRF-based methods needed roughly <strong>two days </strong>of training and rendered at less than <strong>1 frame per second</strong>.</p><p>It renders beautifully and trains fast. What it does not produce is a mesh, and most of the existing 3D world (game engines, AR/VR toolchains, CAD software, physics engines, 3D printing pipelines) is built entirely around meshes, not clouds of translucent blobs.</p><h4>The Catch: Why a Blob Cloud Is Not Enough</h4><p>That mismatch is the real motivation for a second, mesh-focused reconstruction step, rather than stopping at a cloud of blobs. A mesh wins on three fronts:</p><ol><li><strong>It drops straight into existing tools.</strong> A mesh opens in a game engine, a 3D editor, or a slicer for 3D printing the same way any other mesh does. No special viewer is needed just to look at the result, and no bespoke integration work is needed to use it somewhere a mesh is expected.</li><li><strong>It avoids an awkward conversion step.</strong> A cloud of Gaussian blobs is a rendering trick, not a mesh. Converting one into the other after the fact (a process generally called <em>mesh extraction</em>) is a genuinely hard problem in its own right. Applied to a scene that was never optimised with a mesh in mind, it often produces bumpy, over-smoothed, or topologically broken surfaces.</li><li><strong>It keeps the speed, not just the shape.</strong> Producing some mesh from photos is not new: multi-view stereo and <a href="https://en.wikipedia.org/wiki/Surface_reconstruction">Poisson surface reconstruction</a> techniques have done that for years, usually slowly and with a real quality ceiling. The harder goal is a mesh that still renders in real time and still looks close to photographic. That is the part Gaussian Splatting made look easy, and the part mesh-based methods have historically struggled to match.</li></ol><h3>Rendering the Scene, Take Two: MeshSplatting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3Oku7t6Bv6ia7xAXDCjbg.png" /><figcaption>A garden scene reconstructed as a mesh with MeshSplatting after 300,000 training iterations.</figcaption></figure><p>Reconstructing directly into mesh form, rather than converting a Gaussian cloud after the fact, is the goal behind <a href="https://meshsplatting.github.io/"><strong>MeshSplatting</strong></a>, presented as an oral paper at CVPR 2026 by Jan Held and a group of collaborators.</p><p>The easiest way to picture what it does is as a variation on the blob idea, with one substitution: instead of soft round blobs, imagine training a scene out of thousands of small, flat, opaque, coloured triangles, like confetti. Each piece is free to move, rotate, resize, and change colour independently. This builds on earlier differentiable-triangle-rendering work rather than starting from scratch.</p><p>Three phases turn that confetti into a finished mesh:</p><ol><li><strong>Training triangle confetti.</strong> The training process follows the same recipe as the blob method: render the confetti from the camera angles COLMAP recovered, compare against the real photos, nudge every triangle a little closer, repeat. This produces a scene made of triangles instead of blobs, but not yet a mesh. A pile of independent confetti, however well it renders, is just a scattered heap. Nothing stitches any triangle’s edge to its neighbour’s, which is exactly what a mesh needs.</li><li><strong>Stitching it into a mesh.</strong> A well-established geometry technique called <em>Delaunay triangulation</em>, restricted to operate along the surface the triangles already approximate, weaves the scattered pieces into one continuous, properly connected surface. It is closer to sewing a patchwork of loose fabric squares into a single quilt than anything resembling the original per-triangle optimisation.</li><li><strong>Polishing the seams.</strong> That stitching is not free. Pulling every triangle into a shared, connected structure shifts things slightly, and the colouring that looked right before stitching no longer lines up cleanly with the adjusted geometry, showing up as faint seams or smudging. A final fine-tuning phase retrains the now-stitched mesh against the original photos again, smoothing out the seams and pushing the surface toward being smooth and geometrically accurate, while keeping the connected structure intact this time.</li></ol><p>That is the whole method: build the scene out of independent flat triangles the same way Gaussian Splatting builds one out of blobs, stitch those triangles into a real mesh, then polish away the visual damage the stitching caused.</p><p>On the standard Mip-NeRF360 benchmark, the reported results put it ahead of MiLo, the prior best mesh-based method for this task:</p><ul><li>Achieving roughly <strong>0.7 dB higher PSNR</strong> (a standard image-quality metric where higher is better).</li><li>Training about <strong>twice as fast</strong>.</li><li>Using roughly <strong>half the memory</strong>.</li></ul><p>The practical payoff is that a scene can be exported directly to a standard mesh file usable in ordinary tools like Blender or a game engine. There is no manual conversion step, and none of the quality loss that comes with extracting a mesh from a representation that was never built with one in mind.</p><h3>Where This Is Headed</h3><p>Mesh-based methods are still catching up to the multi-year head start point-based techniques like Gaussian Splatting have had, both in visual quality and in the tooling built up around them. The direction of travel across recent work is fairly consistent:</p><ul><li>Narrow the quality gap with point-based splatting.</li><li>Hold onto the training speed and rendering performance that made splatting compelling in the first place</li><li>Treat direct compatibility with existing mesh pipelines (game engines, AR/VR, fabrication) as a first-class goal, not an afterthought bolted on with a separate extraction step</li></ul><p>MeshSplatting is one recent data point in that trajectory, not the end of it.</p><p>This post builds directly on top of open research and tooling. Full credit to the COLMAP team, to Kerbl et al. for 3D Gaussian Splatting, and to Held et al. for MeshSplatting, for the underlying methods described here.</p><p><em>Many thanks to Shisheng Huang, Elwin Tay, and the rest of the Processing Modelling &amp; Simulation team at HTX for their guidance and mentorship throughout this project’s duration!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac5d3fa59a33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/from-photos-to-playable-mesh-a-technical-primer-on-modern-3d-scene-reconstruction-ac5d3fa59a33">From Photos to Playable Mesh: A Technical Primer on Modern 3D Scene Reconstruction</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding Agents — Out of the Browser, Into the Terminal]]></title>
            <link>https://medium.com/htx-dsai/coding-agents-out-of-the-browser-into-the-terminal-87cb68fc8647?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/87cb68fc8647</guid>
            <category><![CDATA[hooks]]></category>
            <category><![CDATA[claude-md]]></category>
            <category><![CDATA[ai-coding-agent]]></category>
            <category><![CDATA[claude-skills]]></category>
            <dc:creator><![CDATA[Joe Ong]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 08:35:46 GMT</pubDate>
            <atom:updated>2026-08-04T08:35:45.058Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G678_g-5puY9zNxO3PL44w.png" /><figcaption>Abstract image of moving coding agent usage from web browser to the terminal, generated by Nano Banana 2</figcaption></figure><p>I work on Polyglot, the Speech-to-Text transcription stack built by HTX xData’s Language AI team. As a team, we’re always looking for ways to use AI to improve and optimize our workflows, and terminal coding agents are one of the tools we’ve been leaning into.</p><p>This article is simply a record of the baseline configs we put in the repo and why. Each setting is in place to enforce AI safeguards, control usage costs, or prevent the codebase from getting harder to understand.</p><p>It is aimed at developers who want more out of a terminal coding agent on a complex codebase, and bring their whole team starting onto a unified baseline. The first half of this article explains my thought process and principles; every setting is gathered into a copy-paste section at the end, so you can read the reasoning or skip straight to the config.</p><h3>The model was rarely the problem</h3><p>Most of us have done this. You hit a bug, copy the offending function into a browser chat, and ask what is wrong. It answers instantly, with total confidence, and often wrongly, because it is guessing at the other functions your snippet calls, the version you pinned, and the whole system that never made it into the paste buffer. So you paste more, and then more, until you have become an expensive clipboard, ferrying context to a model reasoning about a codebase it has never seen.</p><p>For a long time that was how many of us worked. It is also one of the worst ways to use these tools, and the fix is less about the model than the tools you give it.</p><h3>Why does the terminal beat the browser?</h3><p>Language models are still trained on text, and a browser chat hands them text while starving them of context. There is no library source, no project structure, no way to open the file next door and check an assumption. So the model fills the gap with something plausible, and on a codebase with years of history, plausible is usually wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*-ha_MmbwGS4mXORyYXmSJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9kSTG8nM9dVum4XkAzBHKw.png" /><figcaption><em>Example of getting the agent to find out about all the bounded and unbounded queues in </em><a href="https://pypi.org/project/websockets/"><em>websockets library</em></a></figcaption></figure><p>A coding agent changes the inputs, not the intelligence. It can open files, follow imports, read the real implementation of the function you are worried about, and check which version of a dependency you actually have. The hallucinations shrink, not because the model got smarter, but because it finally stopped guessing. Even a bare install, with no configuration at all, is a large step up from the browser tab.</p><p>That alone is the single highest-leverage move most people can make. Everything after it is refinement, and the rest of this piece is the refinement we settled on.</p><h3>How hard should you lean on the agent?</h3><p>Handing an agent the entire repository is a strategic choice that is worth thinking about.</p><p>At one end, there are the teams that <a href="https://ziglang.org/code-of-conduct/">ban these tools outright</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JEweqpyM7y5QAptk54rofQ.png" /><figcaption>Zig’s Strict No LLM / AI Policy</figcaption></figure><p>At the other, there are the enthusiasts <a href="https://youtu.be/boilaC1Qo2c?t=98">running dozens of agents in parallel</a>, <a href="https://code.claude.com/docs/en/ultraplan">going overboard with planning provided by coding agents</a>, trying to squeeze every last dime out of a subscription.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*epZDIP5o8rpwT8_AHV_B3w.png" /><figcaption>Power users running out of their weekly usage limits</figcaption></figure><p>We deliberately chose to sit in the middle.</p><p>We want developers leaning on a model that can see the implementation, without leaning so hard that costs balloon, or <a href="https://addyosmani.com/blog/comprehension-debt/">the gap widens between how much code exists and how much of it any human actually understands</a>.</p><p>Sitting in the middle is not a vibe, it is a set of choices. The five principles that follow are those choices, each a deliberate limit on how far we let the agent run:</p><ol><li>Keep everything in the repo,</li><li>Hard-block the irreversible,</li><li>Build for any coding agent,</li><li>Spend only where it changes the answer,</li><li>Stay in the smart zone of your context window.</li></ol><h3>Principle 1 — Keep everything in the repo</h3><p><em>Everyone clones the same baseline config.</em></p><p>The first principle that shapes every other, is that every piece of the configuration lives inside the project, committed next to the code, not in anyone’s personal dotfiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*kO10vSFYOxc-IdCKn_0txw.png" /><figcaption>Having the coding agent configuration live inside the project and committed</figcaption></figure><p>Most people will not go out of their way to learn the sharp edges of a new tool, and a few keen ones will build something genuinely good that lives only on their own machine. Put those together and you get an invisible inequality. One person has an elaborate private rig, everyone else is on bare defaults, and someone eventually asks the question that gave this whole effort its purpose. Why does my agent feel worse than everyone else’s? Nobody did anything wrong, and yet the team is quietly running at two different speeds.</p><p>Putting the configuration in the repository removes that gap by default. Clone the project and you inherit the same model, the same guardrails, and the same habits as the person next to you. Configuration will then grow alongside the team!</p><h3>Principle 2 — Hard-block the irreversible, suggest the rest</h3><p><em>A sign to suggest, a wall to deny.</em></p><p>Two mechanisms do the blocking. The first is permission rules, which sort commands into three buckets. Read-only inspection is waved through, destructive file operations ask first, and the genuinely irreversible actions are denied outright.</p><p>The agent may run whatever it needs to understand the codebase, but actions that leave a permanent mark stay in human hands. A commit is the team’s signature on a change, and I am not comfortable automating that yet.</p><p>The second mechanism is hooks, which exist because rules have a gap. A rule can match rm -rf but miss a command where the danger is chained behind something harmless, like echo done &amp;&amp; cd /tmp. A hook is a small shell script that runs just before the command and inspects the whole line, catching the chained cases a tidy rule misses. cd-guard.sh (see <a href="https://medium.com/p/87cb68fc8647#b54b">below</a>) stops the agent leaving the repo, resolving symlinks and relative paths first so it cannot be fooled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y0uz8wk3oqpYc8bMWKguVg.png" /><figcaption>A coding agent trying to access my work Obsidian vault</figcaption></figure><p>A hard block wastes a little of the model’s effort; it crafts a command, gets stopped, and tries again. That is why the two halves work together. The hook is the wall that makes the bad outcome impossible; the note in the context file is the sign in front of it, saving the wasted attempt. The wall protects the team’s trust, the sign protects its tokens. Covering what must never happen is what lets a developer stop watching the agent’s hands, and that is what makes a team actually adopt the tool.</p><p>Additionally, the allow bucket matters as much as the deny bucket. Waving read-only inspection through, listing files, reading a diff, grepping the repo, keeps the agent moving instead of asking before it can even look. The deeper reason is human. A <a href="https://static1.squarespace.com/static/550b09eae4b0147d03eda40d/t/5dc462670af3a6323cb8fdba/1573151360610/Past-present-future-of-ego-depletion.pdf#:~:text=Is%20ego%20depletion%20real%3F%20This%20question%20seems,the%20outs.%20Deserved%20or%20not%2C%20the%20topic.">developer has limited bandwidth</a>, and if every harmless ls pops a prompt, you approve on reflex, and that reflex is still running when the one dangerous command appears. An alarm that goes off for everything is one you stop hearing.</p><h3>Principle 3 — Build for any coding agent</h3><p><em>Bet on the principle, not the model.</em></p><p>The third principle, the one I hold most stubbornly, is that the setup should not be built around the quirks of the “model of the month”.</p><p>Part of the rationale is portability. The hooks, the in-repo config, the habit of planning before editing, none of it is specific to one platform. If next year the better move is to run two agents to review each other’s work, I want a baseline that ports rather than one I rebuild from scratch.</p><p>The other rationale is refusing to build scaffolding for weaknesses the next model will not have. The clearest example is the context file itself. The common advice is to run the agent’s <a href="https://code.claude.com/docs/en/best-practices#write-an-effective-claude-md">init</a> command, let it generate a long file describing your repository, and commit it. We hand-wrote a short one instead, and the research behind that almost argues against having the file at all.</p><p>A 2026 study found that both machine-generated and developer-written context files tended to <a href="https://arxiv.org/abs/2602.11988">lower task success against giving the agent no repository context</a>, while adding more than twenty percent to inference cost by nudging the agent into broader, less focused exploration. The file is usually a liability, so the only version worth keeping is a tiny, deliberate one stating what the model cannot infer and nothing else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fs6pFALlzTGFoN72hbIMw.png" /><figcaption>Success rates of coding agents with different context file settings <em>on SWE-BENCH LITE (left) and CTX BENCH (right). From Gloaguen et al. (2026). </em>Original paper<strong>:</strong> <a href="https://arxiv.org/pdf/2602.11988">arXiv:2602.11988</a></figcaption></figure><p>So ours is short by design. It points the agent at ARCHITECTURE.md first, tells it to read before writing and not to re-read unchanged files, and grows with the team. A short file gets read every session; a long one gets skimmed and taxes you tokens on every turn whether it helps or not.</p><p>That one file is orientation, not documentation. We keep an ARCHITECTURE.md under a couple of hundred lines mapping where each app and library lives and how they connect, just enough that a fresh agent or a new teammate gets oriented in one read. A small update-architecture skill (bottom of the article) keeps it current as the structure drifts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qnhH-uWMnSyPgvCJEu8_rg.png" /><figcaption>Sample of the generated ARCHITECTURE.md file that provides basic orientation for a fresh context to navigate the repo, refreshed as the project improves over time</figcaption></figure><h3>Principle 4 — Spend where it changes the answer</h3><p><em>Expensive where it counts, frugal everywhere else.</em></p><p>The fourth principle is to pay for tokens that change the AI output and limit spending on everything else.</p><p>Spend where it changes the answer. Two dials cost real money on most coding agents, which model you point it at and how hard you let that model think on each turn, and we pushed both toward the expensive end on purpose. Make that same call against your own agent and model rather than copying our exact pins. Most agents expose the thinking dial as a reasoning or effort setting, and the published benchmarks all point the same way.</p><p>For example, Claude Opus 4.8’s high setting is a straight improvement over the medium one for a small extra cost, while the rungs above it are the diminishing-returns you pay a lot for and rarely feel. For whatever coding agent you choose to run, choose the appropriate model for the appropriate task!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozP4tgvGfwZ5Dy6adcI_7A.png" /><figcaption>DeepSWE scores coding agents on 113 novel software tasks and plots each against its cost. <em>Every curve bends at the top: the last rung of “thinking” buys a point or two for a lot more money. </em>Source: <a href="https://deepswe.datacurve.ai/">https://deepswe.datacurve.ai/</a></figcaption></figure><p>Save everywhere it does not. A plugin or a skill that is loaded into context on every turn but used once a month is not free, and the cost determines whether or not it ever helps, so we are sparing about what we install. The <a href="https://github.com/obra/superpowers">Superpowers plugin</a> is a good example of cherry-picking rather than wholesale ingestion. I lean on its brainstorming workflow constantly, talking a change through one question at a time before any code is written, because that interrogation is where understanding actually forms. The rest of its machinery I simply do not invoke. A code-review skill takes a first pass over merge requests and clears mechanical issues, so freeing up cognitive bandwidth so that human developers focus on the question a machine cannot answer — whether the change actually makes sense.</p><h3>Principle 5 — Stay in the smart zone of your context window</h3><p><em>Stay clean, stay smart, hand off before it fills.</em></p><p>The sharpest token-saving technique is not in the config at all. It is context hygiene, and it earns a principle of its own. A model’s recall gets worse as its window fills. Benchmarks show the same slide for every frontier model, holding up through the first few hundred thousand tokens before it decays, and our team sees hallucinations past the 400k mark. The million-token window is headroom that still rots, not a bucket you fill without cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6GOVsc8RG2B32FIELvZoA.png" /><figcaption>No matter which frontier model, retrieval deteriorates greatly across long context (1 million tokens), shown from needle-in-a-haystack benchmark. Source: <a href="https://claude.com/blog/1m-context-ga">https://claude.com/blog/1m-context-ga</a></figcaption></figure><p>Check your agent’s auto-compaction value. You should trigger <strong>manually</strong> when it is still sharp rather than at the cliff edge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*onF13PBSmzqApVV-4OJpDg.png" /><figcaption>Many agents do not auto-compact until the window is nearly full, long after recall has begun to slide. Source: <a href="https://opencode.ai/docs/config/#compaction">https://opencode.ai/docs/config/#compaction</a></figcaption></figure><p>The most visible piece of the setup is a custom status line that shows, on every turn, how much of the window is left, the way a fuel gauge shows range. It runs green at the start, turns amber once a fifth is gone and starts suggesting a handoff, and goes red at thirty percent.</p><p>The habit the gauge builds is <strong>reaching for </strong><strong>/clear on every genuinely new question</strong>, rather than dragging a polluted context along. The exception is when you want to carry a thread forward, and for that a session-handoff skill writes a terse summary first, the decisions made, files touched, what is still running and how to verify, addressed to the next instance of the agent, so the new session starts oriented instead of cold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUrvth9ZkYlckj9RDfhadA.png" /><figcaption>The status line starts suggesting a session handoff once a fifth of the window is used. Source at the bottom of the article!</figcaption></figure><p>None of us are burning huge token bills today, and that is exactly why I am setting the habit now. When you work with abundance, everything gets treated as disposable, usage quietly balloons as more developers join the team. Work as if tokens were scarce and every spend gets a thought first. The status line is the small, constant nudge that builds this mindset.</p><h3>When might you not need any of this?</h3><p>If you work alone on a small, fresh codebase, a recent agent and model is good enough that most of these configs are unnecessary overhead. Take the one move that matters, get out of the browser and into the terminal, and leave the rest.</p><p>The setup earns its keep when the conditions change. A codebase with history, where plausible-looking code is easy to write and hard to verify. A team, where one person’s private rig becomes everyone else’s mystery. A budget that must scale to more people without scaling out of control. That is the project this was built for, and if it is yours too, the principles start paying for themselves.</p><h3>What changes from here?</h3><p>This baseline is not finished, it is just committed. The deny list will loosen as the review flow around it strengthens, and the model pin will change the month a better one ships. The tools will keep changing. The principles are the part I expect to survive.</p><p>Many thanks to the HTX Language AI team for the experiments, the objections, and the shared config that shaped this setup.</p><h3>The settings, in one place</h3><p>Finally, everything below is a trimmed version of the baseline config. Treat it as a starting point and delete what does not fit your project. I used Claude Code as an example, but the same shape ports to any coding agents like OpenCode or Codex; adapt the settings, hooks, and skills to whatever it expects. Most of these were not hand-written either. Describe it to the agent and let it apply them! The principles transfer across different coding agents.</p><p><strong>CLAUDE.md / </strong><strong>AGENTS.md / </strong><strong>CODEX.md, etc, kept short.</strong> Read ARCHITECTURE.md first, think before acting, read before writing, do not re-read unchanged files, do not guess at versions or flags or package names, use the project&#39;s package manager, and keep output concise. User instructions in the chat always override it.</p><p>Some sources to take inspiration from, applicable to ANY main markdown file (CLAUDE.md, AGENTS.md, CODEX.md, etc.):</p><ul><li><a href="https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md">Andrej Karpathy’s Inspired CLAUDE.md guidelines</a></li><li><a href="https://github.com/drona23/claude-token-efficient/blob/main/CLAUDE.md">claude-token-efficient project</a>, which includes code specific examples as well</li></ul><p><strong>settings.json</strong>. The model pin forces the 1M-context window, effort: high is the sweet spot before higher settings burn tokens for little gain, defaultMode: plan makes the agent think before it acts, and ENABLE_TOOL_SEARCH lets MCP tools load only when needed instead of on every prompt.</p><pre>{<br>  &quot;model&quot;: &quot;claude-opus-4-8[1m]&quot;,<br>  &quot;effortLevel&quot;: &quot;high&quot;,<br>  &quot;enabledPlugins&quot;: { &quot;superpowers@claude-plugins-official&quot;: true },<br>  &quot;env&quot;: { &quot;ENABLE_TOOL_SEARCH&quot;: &quot;true&quot; },<br>  &quot;statusLine&quot;: {<br>    &quot;type&quot;: &quot;command&quot;,<br>    &quot;command&quot;: &quot;bash \&quot;$(git rev-parse --show-toplevel)/.claude/statusline.sh\&quot;&quot;<br>  },<br>  &quot;permissions&quot;: {<br>    &quot;defaultMode&quot;: &quot;plan&quot;,<br>    &quot;allow&quot;: [<br>      &quot;Bash(ls)&quot;, &quot;Bash(wc:*)&quot;, &quot;Bash(jq)&quot;,<br>      &quot;Bash(git status)&quot;, &quot;Bash(git log *)&quot;,<br>      &quot;Bash(git diff *)&quot;, &quot;Bash(git show *)&quot;<br>    ],<br>    &quot;ask&quot;:  [ &quot;Bash(rm *)&quot;, &quot;Bash(rm -rf *)&quot;, &quot;Bash(mv *)&quot; ],<br>    &quot;deny&quot;: [<br>      &quot;EnterWorktree&quot;, &quot;Bash(git worktree *)&quot;, &quot;Read(*.env)&quot;,<br>      &quot;Bash(git add *)&quot;, &quot;Bash(git push *)&quot;, &quot;Bash(git commit *)&quot;<br>    ]<br>  }<br>}</pre><p><strong>One example hook (</strong><strong>cd-guard.sh).</strong> Wired under hooks.PreToolUse with a Bash matcher. The rest of our guards follow the same pattern for things specific to our stack. I would advise you to try out any coding agent in your project, and craft hooks/rules to guard against things you repeatedly don’t want it to do!</p><pre>#!/usr/bin/env bash<br>set -uo pipefail<br><br>input=$(cat)<br>cmd=$(echo &quot;$input&quot; | jq -r &#39;.tool_input.command // &quot;&quot;&#39;)<br><br>[ -z &quot;$cmd&quot; ] &amp;&amp; echo &#39;{}&#39; &amp;&amp; exit 0<br><br>repo_root=$(git rev-parse --show-toplevel 2&gt;/dev/null)<br>[ -z &quot;$repo_root&quot; ] &amp;&amp; echo &#39;{}&#39; &amp;&amp; exit 0<br><br># Extract all cd targets from the command (handles &amp;&amp;, ;, |, subshells)<br>cd_targets=$(echo &quot;$cmd&quot; | grep -oP &#39;(?:^|[;&amp;|]\s*|&amp;&amp;\s*|\|\|\s*)cd\s+\K[^\s;&amp;|]+&#39; 2&gt;/dev/null)<br><br>[ -z &quot;$cd_targets&quot; ] &amp;&amp; echo &#39;{}&#39; &amp;&amp; exit 0<br><br>for target in $cd_targets; do<br>  # Expand ~ to home<br>  target=&quot;${target/#\~/$HOME}&quot;<br><br>  # Resolve relative paths against repo root (safest assumption for CWD)<br>  if [[ &quot;$target&quot; != /* ]]; then<br>    target=&quot;${repo_root}/${target}&quot;<br>  fi<br><br>  # Resolve to canonical path (follow symlinks, resolve ..)<br>  resolved=$(realpath -m &quot;$target&quot; 2&gt;/dev/null || echo &quot;$target&quot;)<br><br>  # Allow /tmp (session scratchpad, temp working files) - never block these.<br>  if [[ &quot;$resolved&quot; == /tmp || &quot;$resolved&quot; == /tmp/* ]]; then<br>    continue<br>  fi<br><br>  # Check if resolved path is under repo root<br>  if [[ &quot;$resolved&quot; != &quot;$repo_root&quot;* ]]; then<br>    echo &quot;{\&quot;decision\&quot;:\&quot;block\&quot;,\&quot;reason\&quot;:\&quot;cd target &#39;${resolved}&#39; is outside the repo root (${repo_root}). Use absolute paths to read external files without changing directory.\&quot;}&quot;<br>    exit 0<br>  fi<br>done<br><br>echo &#39;{}&#39;</pre><p><strong>Status line.</strong> A short statusline.sh prints two lines: project, branch, model, and effort on the first, and the context-remaining bar plus the rate-limit reset on the second, coloured green then amber then red as the window fills, with a nudge to hand off once you cross into amber.</p><pre>#!/usr/bin/env bash<br># Example Claude Code status line<br><br>input=$(cat)<br><br># --- Extract fields ---<br>project_dir=$(echo &quot;$input&quot; | jq -r &#39;.workspace.project_dir // .workspace.current_dir // &quot;&quot;&#39;)<br>branch=$(GIT_OPTIONAL_LOCKS=0 git -C &quot;$project_dir&quot; symbolic-ref --short HEAD 2&gt;/dev/null || echo &quot;&quot;)<br>model=$(echo &quot;$input&quot; | jq -r &#39;.model.display_name // .model.id // &quot;unknown&quot;&#39;)<br>version=$(echo &quot;$input&quot; | jq -r &#39;.version // &quot;?&quot;&#39;)<br>output_style=$(echo &quot;$input&quot; | jq -r &#39;.output_style.name // &quot;default&quot;&#39;)<br><br># Effort level: prefer live session value from stdin, fall back to settings files<br>effort_raw=$(echo &quot;$input&quot; | jq -r &#39;.effort.level // empty&#39;)<br>if [ -z &quot;$effort_raw&quot; ] &amp;&amp; [ -n &quot;$project_dir&quot; ] &amp;&amp; [ -f &quot;${project_dir}/.claude/settings.json&quot; ]; then<br>  effort_raw=$(jq -r &#39;.effortLevel // empty&#39; &quot;${project_dir}/.claude/settings.json&quot; 2&gt;/dev/null)<br>fi<br>if [ -z &quot;$effort_raw&quot; ] &amp;&amp; [ -f &quot;${HOME}/.claude/settings.json&quot; ]; then<br>  effort_raw=$(jq -r &#39;.effortLevel // empty&#39; &quot;${HOME}/.claude/settings.json&quot; 2&gt;/dev/null)<br>fi<br>case &quot;$effort_raw&quot; in<br>  low|medium|high|xhigh|max) effort_label=&quot;$effort_raw&quot; ;;<br>  *) effort_label=&quot;&quot; ;;<br>esac<br><br># Context remaining<br>used_pct=$(echo &quot;$input&quot; | jq -r &#39;.context_window.used_percentage // empty&#39;)<br>remaining_pct=$(echo &quot;$input&quot; | jq -r &#39;.context_window.remaining_percentage // empty&#39;)<br><br># Rate limit reset<br>reset_epoch=$(echo &quot;$input&quot; | jq -r &#39;.rate_limits.five_hour.resets_at // empty&#39;)<br>rate_used_pct=$(echo &quot;$input&quot; | jq -r &#39;.rate_limits.five_hour.used_percentage // empty&#39;)<br><br># --- Line 1: file | branch | model | version | output style ---<br>parts=&quot;&quot;<br><br># File (full path)<br>if [ -n &quot;$project_dir&quot; ]; then<br>  parts=&quot;📂 Project Dir: ${project_dir}&quot;<br>fi<br><br># Branch<br>if [ -n &quot;$branch&quot; ]; then<br>  parts=&quot;${parts}   🌿 Branch: ${branch}&quot;<br>fi<br><br># Model<br>if [ -n &quot;$model&quot; ]; then<br>  parts=&quot;${parts}   🧠 Model: ${model}&quot;<br>fi<br><br># Effort level<br>if [ -n &quot;$effort_label&quot; ]; then<br>  parts=&quot;${parts}   💪 Effort Level: ${effort_label}&quot;<br>fi<br><br>printf &quot;%s\n&quot; &quot;$parts&quot;<br><br># --- Line 2: context remaining + reset timer ---<br>line2=&quot;&quot;<br><br># Context remaining with bar<br>if [ -n &quot;$remaining_pct&quot; ]; then<br>  remaining_int=$(printf &#39;%.0f&#39; &quot;$remaining_pct&quot;)<br>  used_int=$(printf &#39;%.0f&#39; &quot;$used_pct&quot;)<br><br>  bar_width=10<br>  filled=$(( remaining_int * bar_width / 100 ))<br>  empty=$(( bar_width - filled ))<br>  bar=&quot;&quot;<br>  for i in $(seq 1 $filled); do bar=&quot;${bar}=&quot;; done<br>  for i in $(seq 1 $empty); do bar=&quot;${bar}-&quot;; done<br><br>  if [ &quot;$used_int&quot; -lt 13 ]; then<br>    color=&quot;\033[32m&quot;<br>    emoji=&quot;🟢&quot;<br>    handoff=&quot;&quot;<br>  elif [ &quot;$used_int&quot; -lt 25 ]; then<br>    color=&quot;\033[38;5;214m&quot;<br>    emoji=&quot;🟠&quot;<br>    handoff=&quot;  💡 Consider /session-handoff&quot;<br>  else<br>    color=&quot;\033[31m&quot;<br>    emoji=&quot;🔴&quot;<br>    handoff=&quot;  ⚠️ Consider /session-handoff&quot;<br>  fi<br>  reset=&quot;\033[0m&quot;<br><br>  line2=$(printf &quot;${color}${emoji} Context Remaining: %d%% [%s]${handoff}${reset}&quot; &quot;$remaining_int&quot; &quot;$bar&quot;)<br>else<br>  line2=&quot;⚪ Context Remaining: --&quot;<br>fi<br><br># Reset timer<br>if [ -n &quot;$reset_epoch&quot; ] &amp;&amp; [ -n &quot;$rate_used_pct&quot; ]; then<br>  now=$(date +%s)<br>  diff=$(( reset_epoch - now ))<br>  if [ &quot;$diff&quot; -gt 0 ]; then<br>    hours=$(( diff / 3600 ))<br>    mins=$(( (diff % 3600) / 60 ))<br>    reset_time=$(date -d &quot;@${reset_epoch}&quot; +%H:%M 2&gt;/dev/null || date -r &quot;${reset_epoch}&quot; +%H:%M 2&gt;/dev/null || echo &quot;??:??&quot;)<br>    rate_int=$(printf &#39;%.0f&#39; &quot;$rate_used_pct&quot;)<br><br>    rate_bar_width=10<br>    rate_filled=$(( rate_int * rate_bar_width / 100 ))<br>    rate_empty=$(( rate_bar_width - rate_filled ))<br>    rbar=&quot;&quot;<br>    for i in $(seq 1 $rate_filled); do rbar=&quot;${rbar}=&quot;; done<br>    for i in $(seq 1 $rate_empty); do rbar=&quot;${rbar}-&quot;; done<br><br>    line2=&quot;${line2}   ⏳ ${hours}h ${mins}m until reset at ${reset_time} (${rate_int}%) [${rbar}]&quot;<br>  fi<br>fi<br><br>printf &quot;%s\n&quot; &quot;$line2&quot;</pre><p><strong>ARCHITECTURE.md.</strong> A living map under a couple of hundred lines, refreshed by a small skill on structural changes. Where things live, how they connect, how to run them. And it is updated by a update-architecture skill, adapt to your codebase as you need it!</p><pre>---<br>name: update-architecture<br>description: Use when starting a new branch, after merging large changes from main, or when repo structure may have drifted from what .claude/ARCHITECTURE.md documents. Manually triggered by the developer.<br>---<br># Update Architecture<br>Refresh `.claude/ARCHITECTURE.md` so it reflects the current repo structure. The goal is **orientation, not documentation** -- point future sessions at the right directory and file, don&#39;t explain what the code does (that&#39;s gleamable by reading it).<br>## Principles<br>- ARCHITECTURE.md is read at the start of every session. Keep it short enough to scan (&lt;150 lines ideal, hard cap 200).<br>- Only record what helps find things: directory purposes, key entrypoints, dependency relationships, how to run things.<br>- Don&#39;t document settings/config class details, auth patterns, Dockerfile internals, or code architecture -- an agent will understand those by reading the files.<br>- If nothing structural changed, don&#39;t touch the file.<br>## Procedure<br>### 1. Gather current state (read-only)<br>Use only tools allowed by repo hooks. These are safe:<br>```<br>Read .claude/ARCHITECTURE.md<br>Glob **/ (top-level dirs)<br>Glob apps/*/  libs/*/  (workspace listing)<br>ls (allowed in settings.json)<br>git log --oneline -30 (allowed)<br>git diff main --stat (allowed, shows what files changed)<br>```<br>Do NOT use: docker commands, server commands, .env reads, git add/commit/push.<br>### 2. Compare documented vs actual<br>Check for:<br>- New top-level directories not in the monorepo structure tree<br>- Removed or renamed directories/apps/libs<br>- New apps or libs (pyproject.toml in a new workspace)<br>- Changed dependency relationships (check `[tool.uv.sources]` in pyproject.toml files)<br>- New docker-compose files or services<br>- New CI config files or pipeline stages<br>### 3. Decide: update or skip<br>If the only changes are code within existing files/directories (bug fixes, feature work, refactors) -- **skip, no update needed**. Architecture didn&#39;t change.<br>If there are structural changes (new dirs, new services, renamed components, changed dependency flow) -- proceed to step 4.<br>### 4. Make minimal edits<br>- Use the Edit tool to make targeted changes to `.claude/ARCHITECTURE.md`.<br>- Add new entries to the monorepo structure tree.<br>- Update dependency flow if relationships changed.<br>- Update the relevant &quot;Key paths&quot; section if a new app/lib was added.<br>- Remove entries for things that no longer exist.<br>- Do NOT rewrite sections that are still accurate.<br>### 5. Verify<br>- Read the final file and confirm line count is under 200.<br>- Confirm all paths mentioned in the file actually exist (Glob or ls spot checks).</pre><p>Handing off sessions via the session-handoff skill. Once triggered, copy and paste the conversation to the next session and start fresh!</p><p>Credits to <a href="https://www.youtube.com/watch?v=_qZvORxGqI0">Nate Herk’s video on solutions to hitting session limits</a></p><pre>---<br>name: session-handoff<br>description: Use when the user says &quot;session handoff&quot;, &quot;wrap up session&quot;, &quot;hand off&quot;, &quot;handoff summary&quot;, or wants a structured end-of-session summary before clearing context. Produces a chat-only handoff covering decisions, shipped changes, key files, running state, verification steps, deferrals, and open questions so a fresh agent can continue seamlessly.<br>---<br># Session Handoff<br>Produce a repeatable end-of-session summary so the user can `/clear` and start a fresh agent without losing continuity. The next agent should be able to pick up by reading this summary alone.<br>This is a **context-handoff artifact**, not a status report. The audience is a future instance of you, not a stakeholder.<br>## When to invoke<br>User says: &quot;session handoff&quot;, &quot;wrap up session&quot;, &quot;hand off&quot;, &quot;handoff summary&quot;, &quot;let&#39;s wrap up&quot;, &quot;summarize before I clear&quot;, or any near-equivalent. Also invoke proactively if the user says they&#39;re about to `/clear` without having run it yet.<br>## How to produce the summary<br>1. **Review the full conversation**, not just the last few turns. Handoffs miss things when they only summarize recent context.<br>2. **Pull state from these sources (in order):**<br>   - Plan files referenced this session (check `~/.claude/plans/` or `&lt;project_root&gt;/.claude/project-plans` if a plan was mentioned).<br>   - TodoWrite state - any in-progress or pending tasks.<br>   - Background processes you started with `run_in_background` - shell IDs are load-bearing for the next agent.<br>   - Files created or modified this session - you know what you touched; don&#39;t grep to re-discover.<br>   - Memory files written or updated (`~/.claude/projects/&lt;project&gt;/memory/`).<br>   - Unresolved questions - things you asked the user that never got a clear answer, or things the user asked that got deflected.<br>3. **Do NOT audit the filesystem.** This is synthesis of what happened in THIS session. No `git log`, no broad `Glob` sweeps. If you didn&#39;t touch it this session, it doesn&#39;t belong here.<br>4. **Produce the output in chat.** Do not write a file. Do not update memory. Chat-only.<br>## Output template - use exactly this structure, every time<br>```<br># Session Handoff - &lt;one-line title of what this session was about&gt;<br>## Where it started<br>&lt;2-3 sentences: what the user asked for, key framing or constraints that emerged&gt;<br>## Decisions locked + what shipped<br>- &lt;decision or change&gt; - &lt;why, and where it lives (absolute path if a file)&gt;<br>- ...<br>## Key files for next session<br>- `&lt;absolute path&gt;` - &lt;why the next agent should read this first&gt;<br>- Plan file: `&lt;path&gt;` (if a plan drove the session)<br>- Memory files touched: `&lt;paths&gt;` (if any)<br>## Running state<br>- Background processes: &lt;shell IDs + what they are + how to kill&gt; - or &quot;none&quot;<br>- Dev servers / ports: &lt;url + port&gt; - or &quot;none&quot;<br>- Open worktrees / branches: &lt;paths&gt; - or &quot;none&quot;<br>## Verification - how to confirm things still work<br>- `&lt;command&gt;` - &lt;expected outcome&gt;<br>- ...<br>## Deferred + open questions<br>- Deferred: &lt;item&gt; - &lt;why pushed to later&gt;<br>- Open: &lt;question needing the user&#39;s input&gt; - &lt;context&gt;<br>## Pick up here<br>&lt;1-2 sentences: the single most likely next action for a fresh agent&gt;<br>```<br>## Hard rules<br>1. **Chat output only.** Never write the handoff to a file. Never update memory from this skill.<br>2. **Never invent state.** If a section has nothing to report, write &quot;none&quot; - do not omit the section. Structure stability is the whole point.<br>3. **Absolute paths always.** The next agent may have a different working directory.<br>4. **If a plan file drove the session, name it first** in &quot;Key files&quot; so the next agent reads it before anything else.<br>5. **No emojis, no hype, no &quot;great job&quot; summaries.** Terse and concrete - paths, commands, shell IDs, decisions. Match the tone of a seasoned engineer handing off at end-of-shift.<br>6. **Background process IDs are critical.** If you started any `run_in_background` shells, their IDs must appear in &quot;Running state&quot; with the kill command - the next agent cannot find them otherwise.<br>## Anti-patterns - do not do these<br>- Summarizing the last 3 turns and calling it a handoff.<br>- Listing files by relative path.<br>- Skipping the &quot;Running state&quot; section because &quot;nothing is running&quot; - write &quot;none&quot; instead.<br>- Writing the summary to `~/.claude/handoffs/` or any file. This is chat-only by design.<br>- Adding a &quot;what went well / what went poorly&quot; retrospective. This isn&#39;t a retro.<br>- Recommending next steps beyond the single &quot;Pick up here&quot; line. The next agent decides; you just hand off.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87cb68fc8647" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/coding-agents-out-of-the-browser-into-the-terminal-87cb68fc8647">Coding Agents — Out of the Browser, Into the Terminal</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can ASR Understand “Chicken Rice 打包 Lah”?]]></title>
            <link>https://medium.com/htx-dsai/can-asr-understand-chicken-rice-%E6%89%93%E5%8C%85-lah-9e4b3f31836e?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/9e4b3f31836e</guid>
            <category><![CDATA[multilingual]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[synthetic-data-generation]]></category>
            <category><![CDATA[code-switching]]></category>
            <dc:creator><![CDATA[Shing Yee]]></dc:creator>
            <pubDate>Fri, 10 Jul 2026 03:33:30 GMT</pubDate>
            <atom:updated>2026-07-10T03:33:28.925Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using LLaMA 3 and text-to-speech to create synthetic code-switched audio for better Singapore ASR</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tv_DTsyugycmFDQnHJe4Sw.png" /><figcaption>Image generated by GPT-5.5</figcaption></figure><h3>Introduction</h3><p><em>“Abang, that chicken rice 打包一下, ரொம்ப oily meh?”</em></p><p>If you are from Singapore, this sentence probably does not feel unusual.</p><p>In a single utterance, we may move across English, Malay, Mandarin, Tamil, dialect expressions, and Singlish particles like <em>lah, lor, </em>or <em>leh.</em> To a local speaker, this sounds natural. To an Automatic Speech Recognition (ASR) system, however, it can be surprisingly difficult.</p><p>This phenomenon is known as <strong>code-switching</strong>: the alternation between two or more languages or language varieties within the same conversation, sentence, or even phrase.</p><p>In multilingual societies like Singapore, code-switching is not a niche behaviour. It is part of how people naturally speak. We switch languages for emphasis, convenience, social identity, humour, or simply because a word comes more naturally in another language.</p><p>This creates a real challenge for speech-to-text (STT) systems. A production-grade ASR model for Singapore speech cannot assume that an utterance remains in a single language from start to finish. It needs to handle rapid language shifts, borrowed words, local pronunciation patterns, and Singlish-specific vocabulary while still producing faithful transcriptions.</p><h4>What this article covers</h4><p>This article walks through the motivation, pipeline, and experiments behind generating synthetic code-switched speech for Singapore ASR:</p><ol><li><a href="#caed">Why code-switching is hard for ASR</a></li><li><a href="#960e">The data problem</a></li><li><a href="#c3ef">The Pipeline: From Monolingual Text to Synthetic Speech</a></li><li><a href="#3662">Why use an LLM for this?</a></li><li><a href="#f2fe">Generating synthetic speech</a></li><li><a href="#a4aa">Next steps</a></li></ol><h4>Why code-switching is hard for ASR</h4><p>At a high level, ASR converts speech into text by learning a mapping from an acoustic signal to a sequence of tokens. Modern ASR systems are typically end-to-end (E2E) deep learning models, often built on Transformer- or Conformer-based architectures. In simplified terms, the encoder processes acoustic features extracted from the waveform, while the decoder generates the corresponding text.</p><p>ASR systems can also be finetuned for specialised domains and speech conditions. This has been an important focus for us in the Home Team context, where speech often contains local accents, operational terminology, and multilingual patterns. For more on this, the article on <a href="https://medium.com/htx-dsai/finetuning-whisper-for-the-singaporean-home-team-context-a3ae1a6ae809"><em>Finetuning Whisper for the Singaporean Home Team Context</em></a> provides a useful discussion of how finetuning can adapt general-purpose ASR models to handle domain-specific Singaporean speech better.</p><p>For monolingual speech, this mapping is already complex. For code-switched speech, the model must infer not only <em>what</em> was said, but also <em>which</em> language or variety is being spoken at each point in time. In practice, this means learning language-specific phonetic patterns, pronunciation variation, and transition points between languages within a single utterance.</p><p>This is where data becomes the bottleneck.</p><p>A model can only generalise to code-switching if it has seen enough representative examples during training. If the training corpus is mostly monolingual, the model defaults to a single dominant language, misses switch points, or entirely normalises unfamiliar words into the wrong language. Even a strong multilingual ASR model will stumble if it’s never been exposed to the messy, mixed nature of real code-switched speech.</p><p>While some recent work suggests that large multilingual ASR models like Whisper can show limited code-switching capability through prompting or zero-shot transfer (Yang et al., 2023), these methods are still brittle, language-pair dependent, and hard to operationalise in domain-specific settings. For practical deployment, especially in Singaporean Home Team speech, representative code-switch data remains the more reliable path forward. Recent Singapore-focused work similarly shows that synthetic code-switch data can improve ASR performance across Southeast Asian language pairs such as Tamil-English, Malay-English, and Mandarin-Malay (Nguyen et al., 2025).</p><h4>The data problem</h4><p>High-quality code-switch speech corpora are much harder to obtain than monolingual datasets. They are expensive to collect, annotate, and validate, especially when multiple languages, local accents, and informal speech patterns are involved.</p><p>So the natural question is:<em> if real code-switch data is limited, how can we still train robust ASR systems?</em></p><p>One promising direction is <strong>synthetic code-switch speech generation</strong>. Instead of relying solely on naturally collected code-switched audio, we can algorithmically generate additional code-switch training data to improve coverage of language transitions, lexical combinations, and speech patterns.</p><p>Recent work has explored this idea from different angles. For example, <em>Conditioning LLMs to Generate Code-Switched Text</em> investigates how LLMs can be fine-tuned to generate code-switched text from monolingual inputs, using English-Spanish as the main language pair (Heredia et al., 2025).</p><p>Our experiment adapts a similar idea to the Singapore context, focusing first on English-Mandarin code-switch text as an intermediate step towards generating synthetic speech for ASR.</p><h3>The Pipeline: From Monolingual Text to Synthetic Speech</h3><p>The goal is to train a model that takes a monolingual text sentence as input and generates a natural code-switched text output, which can then be converted into synthetic speech.</p><p>The overall pipeline looks like this (Figure 1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*27-IbH4ZuqEMktz3f6dlaA.png" /><figcaption>Figure 1: Overall pipeline of fine-tuning LLM to generate code-switch data</figcaption></figure><p>For this experiment, we used open-source datasets such as <strong>SEAME Dev Man</strong> and <strong>CS Dialogue</strong>, which contain short, conversational, and naturally occurring code-switched text well-suited for this task.</p><p>After data collection, the text was curated and normalised. This preprocessing step involved removing irrelevant tags and applying language identification (LID) to identify which spans belonged to which language.</p><p>This language-span information was important because the next step is to reconstruct monolingual versions of each code-switched sentence.</p><p>For each code-switched sentence, we generated monolingual counterparts by translating the spans belonging to the other language while preserving the original meaning of the utterance (Figure 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L68kGlUR9_IjaXVjp39vHQ.png" /><figcaption>Figure 2: Example of getting monolingual text</figcaption></figure><p>This monolingual-to-code-switched pairing forms the basis of the supervised training setup. In other words, the model is trained to take a monolingual sentence (X) as input and generate its code-switched version as output (Y).</p><h3>Why use an LLM for this?</h3><p>Code-switch generation is not just a dictionary replacement problem. Randomly translating words may create a multilingual sentence, but it may not sound like something a bilingual speaker would actually say. A good output needs to preserve meaning, remain fluent, and place language switches at plausible points.</p><p>This is where an LLM becomes useful. Compared with rule-based substitution, an LLM can better model context, fluency, and sentence-level meaning.</p><p>However, we found that not all LLM variants behaved equally well.</p><p>A natural question is: <em>why not just use ChatGPT?</em> While it is strong for general-purpose generation, it is less ideal when we need reproducibility, cost control, data governance, and fine-grained control over the generation process. Since the goal is to build a scalable pipeline for domain-specific code-switch data generation, it is more practical to evaluate controllable LLM variants that can be tuned, inspected, and deployed more flexibly.</p><p>From there, the experiments focused on one central question:</p><blockquote><strong>How do we get a model to generate code-switched text that is both natural and controllable, without introducing too much hallucination?</strong></blockquote><p>This was explored through a series of three experiments:</p><ol><li><a href="#5602"><strong>Experiment 1: getting the translations right</strong></a></li><li><a href="#d8d3"><strong>Experiment 2: how much prompt structure is too much?</strong></a></li><li><a href="#97c4"><strong>Experiment 3: evaluating synthetic code-switch text</strong></a></li></ol><h4>Experiment 1: getting the translations right</h4><p>A key part of the pipeline was reconstructing<strong> </strong>monolingual counterparts from naturally occurring code-switched text.</p><p>This step matters because the quality of these reconstructed monolingual sentences directly affects the supervision signal used for fine-tuning. If the translation is poor, the model is effectively trained on noisy input-output pairs.</p><p>To address this, we benchmarked several translation models and selected GPT-4.1, which performed best on the <a href="https://www.kaggle.com/datasets/qianhuan/translation">Chinese-English translation dataset</a> (Tables 4 and 5).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*dHlkJ7RVeMUyX9Tzlz38jg.png" /><figcaption>Table 4: English to Mandarin translation BLEU Score comparison</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*rQ99QpoR23r9EsBZi7BeYg.png" /><figcaption>Table 5: Mandarin to English translation BLEU Score comparison</figcaption></figure><p>GPT-4.1 came out ahead in both directions, and that’s what we used to generate the monolingual counterparts for fine-tuning.</p><p>Once the monolingual versions were generated, the dataset was further cleaned, preprocessed, and split into train, development, and test sets.</p><h4>Experiment 2: how much prompt structure is too much?</h4><p>Another major experiment involved the prompt format.</p><p>We tested different input-output structures to determine which one best guided the model towards clean and faithful code-switched generation.</p><p>The minimal format was a direct mapping:</p><pre>&lt;X&gt;=&lt;Y&gt;</pre><p>A slightly clearer format:</p><pre>INPUT: &lt;X&gt;<br>OUTPUT: &lt;Y&gt;</pre><p>And a fully structured format with explicit task instruction:</p><pre>TASK: Rewrite the sentence into English–Mandarin code-switched text.<br>INPUT: &lt;X&gt;<br>OUTPUT: &lt;Y&gt;</pre><p>The minimal prompt gave the model more flexibility, but it also increased the risk of hallucinated continuations, repeated phrases, and malformed tags.</p><p>The structured prompt generally produced cleaner outputs. The explicit task instruction seemed to act as soft guidance, helping the model better understand the expected transformation.</p><p>Because of this, we ultimately leaned towards the `TASK/INPUT/OUTPUT` format for the final setup. It provided enough structure to stabilise generation, without overcomplicating the prompt (Table 6), while Table 8 provides definitions for each evaluation metric.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*gD_m_AfGAJ1jpgrTYg_ZaQ.png" /><figcaption>Table 6: Output quality across prompt formats. Values are reported as the number of samples out of 200, with percentages shown in parentheses.</figcaption></figure><p>The key takeaway is that prompt format matters, even for a fine-tuned model.</p><p>Small formatting choices can strongly influence whether the model treats the task as a clean transformation or drifts into a messy continuation behaviour.</p><h4>Experiment 3: evaluating synthetic code-switch text</h4><p>Evaluation is one of the hardest parts of this project.</p><p>For standard text generation tasks, we often use automatic metrics such as BLEU, ChrF, or BERTScore (Table 7). We used these metrics to compare generated outputs against gold code-switched references from the original datasets.</p><p>However, code-switch generation is not a standard text-matching problem.</p><p>A generated sentence can have low lexical overlap with the reference but still be a perfectly valid code-switched sentence. Conversely, a sentence can score well on overlap-based metrics but still sound unnatural to a bilingual speaker.</p><p>This is especially true because there are many valid ways to code-switch while preserving the same meaning.</p><p>For example, two speakers may express the same idea with different switch points:</p><ol><li><em>I think this one 很贵 leh.</em></li><li><em>这个 really quite expensive leh.</em></li></ol><p>Both can be acceptable, depending on the speaker and context.</p><p>This means automatic metrics are useful as rough indicators, but they cannot fully capture fluency, naturalness, or cultural authenticity. Heredia et al. also found that traditional automatic metrics do not correlate well with human judgement when assessing generated code-switched text.</p><p>Because of this, we evaluated the outputs across both semantic and structural dimensions (Table 8).</p><p>The automatic evaluation included:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*JPs5_7qH1clNr7L3hfh8ow.png" /><figcaption>Table 7: Automatic evaluation metrics</figcaption></figure><p>We also tracked generation quality issues such as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*3kfKc7AxPOUPCSRyuKE8yw.png" /><figcaption>Table 8: Generation quality metrics</figcaption></figure><p>These additional metrics were useful because they captured failure modes that BLEU or BERTScore may miss. For example, a sentence can be semantically close to the reference but still be unusable if it contains broken tags or repeated fragments.</p><blockquote><em>LLaMA 3 8B was used as the starting model because it offered a practical balance between language capability, model size, and fine-tuning feasibility. The base model was preferred because it followed the sentence-rewriting objective more cleanly, whereas the instruct model often added explanations or extra formatting.</em></blockquote><h3>Generating synthetic speech</h3><p>Once the synthetic code-switched text was generated, the final step was converting it to audio using Text-to-Speech (TTS).</p><p>For this experiment, we used <a href="https://github.com/fishaudio/fish-speech"><strong>FishAudio</strong></a>. To make the speech sound more locally grounded, we used a short 10–30 seconds clip from a Singapore podcast as reference audio, together with its transcript. This allowed the TTS model to perform zero-shot voice cloning, where it generates new speech in a similar voice style without requiring full model fine-tuning.</p><p>An example of the output:</p><ul><li><strong>Monolingual text</strong>: “No matter what everyone else says or how much they judge.”</li><li><strong>Synthetic code-switched text</strong>: “&lt;zh&gt;无论别人怎么说, 或者怎样&lt;/zh&gt; &lt;en&gt;judge.&lt;/en&gt;”</li><li><strong>Synthetic audio</strong>:</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2303409299%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fshing-yee-chan%2Fexample-synthetic-en-zh-code%3Fsi%3Dabba2411ef5241abadfe7a2d9a0e5438%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/978c3add127f9099358fa5bffb44810b/href">https://medium.com/media/978c3add127f9099358fa5bffb44810b/href</a></iframe><h3>Next Steps</h3><h4><strong>Better evaluation</strong></h4><p>Evaluating synthetic code-switch text remains a major challenge. At present, assessment still relies heavily on automatic metrics and human judgement. In our manual review of 100 randomly sampled outputs, the generated sentences were sometimes lightly paraphrased, but most remained coherent and semantically consistent.</p><p>However, a stronger evaluation framework is needed.</p><p>Future evaluation should consider:</p><ul><li>Whether the meaning is preserved</li><li>Whether the switch points are natural</li><li>Whether the output sounds like something a bilingual speaker would actually say</li><li>Whether Singlish and colloquial expressions are used appropriately</li><li>Whether the generated data improves downstream ASR performance</li></ul><p>Ultimately, the best test may not be whether the synthetic text looks similar to a reference sentence. The more important question is: <em>Does this synthetic data help an ASR model transcribe real code-switched speech better?</em></p><h4><strong>Expanding beyond English-Mandarin</strong></h4><p>Currently, the pipeline focuses on English–Mandarin code-switching.</p><p>A natural next step is to expand it to Singapore’s four main languages:</p><ul><li>English</li><li>Mandarin Chinese</li><li>Malay</li><li>Tamil</li></ul><p>It would also be important to incorporate Singlish discourse particles, dialect expressions, and local speech patterns.</p><p>This matters because Singapore code-switching is not limited to clean bilingual pairs. Real conversations often involve multiple languages, informal expressions, and culturally specific phrasing.</p><p>A truly Singapore-ready ASR system needs to handle that complexity.</p><h4><strong>Better Singapore-style TTS</strong></h4><p>Text generation is only one part of the pipeline.</p><p>To create useful speech training data, we also need a strong multilingual TTS that can pronounce code-switched Singapore speech naturally.</p><p>This is difficult because the model must handle:</p><ul><li>Multiple languages</li><li>Local pronunciation</li><li>Mixed-language phrasing</li><li>Speaker variation</li><li>Informal conversational rhythm</li></ul><p>If the TTS output sounds unnatural, the resulting synthetic speech may not help the ASR model much. In the worst case, it could teach the ASR model the wrong acoustic patterns.</p><p>So, improving Singapore-style multilingual TTS is an important next step.</p><h4><strong>Fine-tuning ASR with mixed real and synthetic data</strong></h4><p>Once higher-quality synthetic text and speech are available, the next step is to combine them with real-world speech data.</p><p>This could involve fine-tuning ASR models using a mixture of:</p><ul><li>Real code-switched speech</li><li>Synthetic code-switched speech</li><li>Monolingual speech</li><li>Local-accent speech</li></ul><p>The goal is not to replace real data, but to improve coverage.</p><p>Synthetic data can help expose the model to more switch points, more sentence patterns, and more language combinations than the real dataset may contain on its own.</p><h3>Conclusion</h3><p>Code-switching is not noise. It is how multilingual communities naturally communicate.</p><p>For Singapore, this means ASR systems cannot be built on monolingual assumptions. They need to handle language mixing, local pronunciation, Singlish expressions, and rapid switch points.</p><p>This project explored one step towards that goal: using LLMs to generate synthetic English-Mandarin code-switched text. The results suggest that synthetic code-switch generation is promising, but delicate. Model choice, prompt format, translation quality, stopping behaviour, and evaluation all matter.</p><p>Most importantly, good synthetic data is not just about randomly mixing languages. It must preserve meaning, sound natural, and reflect how bilingual speakers actually communicate.</p><p>There is still more to improve, especially around evaluation, multilingual expansion, and Singapore-style TTS. But as ASR systems become more common in multilingual environments, synthetic code-switched data may help make speech technology more inclusive, localised, and robust.</p><p>After all, if humans can understand:</p><p><em>“Anneh, that chicken rice 打包一下, ரொம்ப oily meh?”</em></p><p>Our speech systems should eventually learn to understand it too.</p><h3>Citation</h3><p>Yang, Y., Peng, Y., Zhong, X., Huang, H., &amp; Chng, E. S. (2023, November 29). <em>Adapting openai’s whisper for speech recognition on code-switch Mandarin-english seame and ASRU2019 datasets</em>. arXiv.org. <a href="https://arxiv.org/abs/2311.17382">https://arxiv.org/abs/2311.17382</a></p><p>Nguyen, T., &amp; Tran, H.-D. (2025, June 17). <em>Can we train ASR systems on code-switch without real code-switch data? case study for Singapore’s languages</em>. arXiv.org. <a href="https://arxiv.org/abs/2506.14177">https://arxiv.org/abs/2506.14177</a></p><p>Heredia, M., Labaka, G., Barnes, J., &amp; Soroa, A. (2026, March 6). <em>Conditioning llms to generate code-switched text</em>. arXiv.org. <a href="https://arxiv.org/abs/2502.12924">https://arxiv.org/abs/2502.12924</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e4b3f31836e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/can-asr-understand-chicken-rice-%E6%89%93%E5%8C%85-lah-9e4b3f31836e">Can ASR Understand “Chicken Rice 打包 Lah”?</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Cascaded Pipelines: Building a Native Spoken Language Model Prototype]]></title>
            <link>https://medium.com/htx-dsai/beyond-cascaded-pipelines-building-a-native-spoken-language-model-prototype-3a9399186592?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/3a9399186592</guid>
            <category><![CDATA[spoken-language-model]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[audio-language-models]]></category>
            <category><![CDATA[multimodal-ai]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <dc:creator><![CDATA[Ng Jia Sheng Jason]]></dc:creator>
            <pubDate>Fri, 29 May 2026 01:54:15 GMT</pubDate>
            <atom:updated>2026-05-29T01:54:13.181Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using spoken language models to better address conversational AI use cases</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDODtXUQoFZrt-eH-wzmMQ.png" /><figcaption>Audio chatbot UI image generated by Nano Banana.</figcaption></figure><p>In one of our previous article, we explored building a <a href="https://medium.com/htx-dsai/xdata-2024-dsai-generative-ai-codefest-8f2fae5fdfb7"><strong>Speech-to-Speech (S2S) chatbot</strong></a> using traditional cascaded pipelines. While cascaded systems (STT → LLM → TTS) may serve basic conversational applications, they fundamentally treat speech as something to be converted into text before any real reasoning happens.</p><p>The industry is now moving toward <strong>universal speech processing systems </strong>(as explained <a href="https://medium.com/htx-dsai/htx-x-meralion-towards-a-spoken-language-model-for-singapore-and-the-home-team-94c55252f8c6">here</a>). They are spoken language models (SLMs) that do not merely transcribe speech, but <em>understand and reason over the acoustic signal itself</em>. This shift is not about replacing working systems for novelty’s sake. It is about overcoming the structural limitations of cascaded pipelines: the loss of prosody and emotion, compounding transcription errors, and latency introduced by multiple processing hops.</p><h3>Why use SLMs in the first place?</h3><p>While cascaded systems are the current industry standard for voice assistants, they suffer from inherent “translation” bottlenecks. Transitioning to a native SLM architecture offers three transformative advantages:</p><h4><strong><em>Preserving the “Soul” of Speech</em></strong></h4><p>In a cascaded system, the ASR model strips away everything except the raw text. You lose the <strong>paralinguistic and non-linguistic features</strong> — the tone, emotion, hesitation, and gender of the speaker.</p><p><strong><em>The SLM Advantage:</em></strong> An SLM encodes these acoustic features directly. The LLM decoder in the model “hears” such features, allowing for a much richer and more empathetic response.</p><h4><strong><em>Eliminating the “Broken Telephone” Effect</em></strong></h4><p>Cascaded pipelines suffer from <strong>cumulative error propagation</strong>. If the ASR model misinterprets a word, that error is fed directly into the LLM. The LLM then generates a response based on a hallucinated premise.</p><p><strong><em>The SLM Advantage:</em></strong> By processing audio natively, there is no intermediate transcription step where errors can take root. The model reasons on the audio signal itself.</p><h4><strong><em>Reducing Latency</em></strong></h4><p>Every hop in a cascaded pipeline — from audio to text, text to reasoning, and text back to audio — requires separate intermediate encoding and decoding steps. This adds milliseconds (or seconds) of “lag” that can disrupt the flow of a natural conversation.</p><p><strong><em>The SLM Advantage:</em></strong> A full S2S SLM operates as a single, fluid inference path, significantly reducing the overhead and making real-time interaction more instantaneous.</p><p>Recognising these structural advantages, we asked ourselves a practical question: how can we make these capabilities tangible for our product teams? We developed <strong>a unified SLM prototype application </strong>that moves beyond simple turn-taking, introducing advanced features like:</p><ul><li><strong>Long-form Audio QA:</strong> Analyzing and querying extended recordings without losing context.</li><li><strong>Audio RAG:</strong> Retrieving relevant audio context for SLMs to base on for accurate answers.</li></ul><p>By integrating these capabilities, we are opening a new design space for conversational AI — one where the model understands the nuances of speech as natively as it does text.</p><h3>Which SLM should we use?</h3><p>With the decision to operationalise SLMs, the next question became: which model should we build on? Given the number of SLM models developed by the open-source community, the next question we asked ourselves was which SLM would serve as a good model for a testing ground. To do this, we established a rigorous benchmarking framework using <a href="https://github.com/AudioLLMs/AudioBench"><strong>AudioBench</strong></a>. Our evaluation specifically targeted datasets featuring <strong>Singaporean accents</strong> and local linguistic nuances, like <a href="https://huggingface.co/datasets/MERaLiON/Multitask-National-Speech-Corpus-v1">MERaLiON/Multitask-National-Speech-Corpus-v1</a> and other internal datasets that focus on tasks like multilingual transcription and spoken QA. After extensive testing across several candidates, we selected <a href="https://huggingface.co/mistralai/Voxtral-Mini-3B-2507"><strong>Voxtral-Mini-3B-2507</strong></a> as our SLM model. Here’s why it stood out:</p><ul><li><strong>Performance: </strong>good benchmarking scores (7% WER on SG-EN-ASR, 77% accuracy on SG speech QA, , etc)</li><li><strong>Model Architecture:</strong> its ability to handle <strong>long-form audio reasoning</strong> up to 40 minutes.</li><li><strong>Ease of training &amp; deployment</strong>: small size of 3B available for quicker finetuning experiments. Integrates seamlessly with <strong>vLLM servers</strong>, allowing us to achieve the high-throughput inference speeds required for responsive products</li></ul><p>Now that we have chosen the SLM to work with, our next step is to brainstorm and develop the application architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9LXtuRfjkU5tmTrhO04LgQ.png" /><figcaption>SLM Prototype Architecture Diagram.</figcaption></figure><p>To empower our product teams to seamlessly test SLMs across diverse use cases, we developed a robust conversational pipeline paired with a dual-input UI. By leveraging <strong>Chainlit</strong> for rapid front-end development, we shifted our focus toward architecting a streamlined speech-to-speech workflow. Because SLMs process audio natively, we eliminated the traditional ASR bottleneck, integrating a fine-tuned TTS model to convert the chosen SLM’s text outputs back into high-quality Singaporean speech. We further pushed the boundaries by augmenting our RAG pipeline to support <strong>multimodal embeddings</strong>, allowing the model to retrieve context from both text and audio sources. While the resulting architecture is elegantly simple, it provides a powerful, highly customizable sandbox — complete with adjustable system prompts and parameters — capable of supporting an infinite variety of conversational experiments.</p><h3>What can SLMs do?</h3><p>The usage of SLM’s native speech processing introduces several novel capabilities that redefine how we interact with audio data. Below are some examples of test cases for the capabilities, a video recording of the demonstration and the respective SLM generated output you can easily refer to.</p><h4>1. High-Density Long-form Audio Analysis</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2270072543%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fjason-ng-870903497%2Fdaily_ketchup_ep484%3Fsi%3De403b557fb5e42328d2134b52711a516%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/df1d0ccf568897904a1e5feb06d59974/href">https://medium.com/media/df1d0ccf568897904a1e5feb06d59974/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdMH0BoaGxH4&amp;type=text%2Fhtml&amp;schema=youtube&amp;display_name=YouTube&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdMH0BoaGxH4%3Ffeature%3Doembed" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e51959a6d59447c82e00bf7c12a4cf1/href">https://medium.com/media/9e51959a6d59447c82e00bf7c12a4cf1/href</a></iframe><blockquote>User: Tell me what this audio is about.<br>Assistant: The audio is a conversation between a forensic pathologist, Dr. Lee, and a group of individuals discussing various topics related to his profession. The conversation covers a range of subjects, including the process of determining the cause of death in cases with multiple injuries, the role of forensic pathologists in investigations, and the challenges and rewards of the job. The speakers also discuss the impact of the hot climate in Singapore on the work of forensic pathologists and the importance of preserving evidence in cases of suspected crimes. Additionally, the conversation touches on the ethical considerations of donating one’s body to science and the personal experiences of the forensic pathologist.</blockquote><blockquote>User: How long does it take to be the pathologist mentioned?<br>Assistant: The quickest path to becoming a forensic pathologist in Singapore is about 11 to 12 years. This includes five years of medical school, a year of housemanship, and five years of training in the specialty.</blockquote><p>Audio is rich with information, ranging from paralinguistic cues to non-linguistic features. Traditionally, processing long audio files in SLMs is either not possible due to the sheer amount of information within audio samples or too computationally intensive, but our prototype utilises <strong>Voxtral’s MLP-based downsampling</strong> to achieve incredible efficiency. We can now compress up to <strong>40 minutes of audio</strong> into a 32k-token context window without losing much information. This allows users to directly query long-form recordings to summarize complex conversations or pinpoint specific facts mentioned for only a few seconds across nearly an hour of dialogue.</p><p>From the example, you can see SLM’s ability to summarise the main themes of the podcast conversation and recount specific “needle-in-a-haystack” information that was retrieved accurately.</p><h4>2. Unified Multimodal Document RAG Retrieval</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2270088734%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fjason-ng-870903497%2Fscdf_hop_pod_ep30_8%3Fsi%3Dd7ec9bd12d69448c9480ef6c896c05e1%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/49606aa268f89d2f876eb5d82ff37464/href">https://medium.com/media/49606aa268f89d2f876eb5d82ff37464/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcVfN-HwJeqE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcVfN-HwJeqE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcVfN-HwJeqE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/81d19308b91b40d67debc56b6338e3bf/href">https://medium.com/media/81d19308b91b40d67debc56b6338e3bf/href</a></iframe><blockquote>User: How many calls were there in the year of 2021?<br>Assistant: There were about 210,000 calls in the year 2021.</blockquote><p>Traditional RAG pipelines are limited to textual data, forcing a dependency on transcripts for audio retrieval. Our SLM prototype eliminates this middle step by integrating <strong>multimodal embedding models</strong> like <a href="https://huggingface.co/vidore/colqwen-omni-v0.1"><strong>ColQwen2.5-Omni</strong></a>. By using dedicated audio encoders to map audio and text into a <strong>shared semantic space</strong>, the pipeline can retrieve relevant context from both file types simultaneously. This allows the SLM to query a unified vector database where audio clips and text documents are indexed within the same dimensional space, retrieving whichever modality best matches the user’s query.</p><p>From the example, both the multi-page PDF document and audio sample are chunked into multiple segments and embedded in the same space in the vector store. Given the example prompt provided regarding calls, only the SCDF audio chunk regarding the number of emergency calls in 2021 is retrieved and used as context to accurately answer the question in the prompt.</p><h4>3. Native Robustness to Noisy Audio</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2270084945%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fjason-ng-870903497%2Fcaller-with-noise%3Fsi%3D108cceb9cd8641c98da2d2bd97218982%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7dd42ecab5a9963c8c1aa6fc37e5174/href">https://medium.com/media/f7dd42ecab5a9963c8c1aa6fc37e5174/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCqBOB0sOfaI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCqBOB0sOfaI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCqBOB0sOfaI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a8b4c46499de0d5fb477557ae4af295/href">https://medium.com/media/3a8b4c46499de0d5fb477557ae4af295/href</a></iframe><blockquote>User: What is mentioned in the audio here?<br>Assistant: The audio mentions that there is a constant high-pitched ringing sound, which is likely an alarm, and that it has been going on for the whole afternoon. It is located at Adams Community Centre, Adams Road, Adam C.C., and the speaker is staying at John Condominium.</blockquote><blockquote>User: What is nick’s phone number?<br>Assistant: Nick’s phone number is 9123456.</blockquote><p>Traditional cascaded pipelines are sensitive to environmental noise; a single ASR misinterpretation can propagate downstream, leading the LLM to reason over an incorrect transcript. In contrast, SLMs reason directly over acoustic representations, avoiding the hard dependency on a single textual intermediate. Rather than committing to one discrete transcription hypothesis, the model retains richer acoustic information throughout inference. This can improve robustness in real-world environments — such as crowded rooms or outdoor settings — where transcription confidence may fluctuate, but semantic cues remain recoverable from the audio signal.</p><p>From the example, the SLMs can accurately describe the audio content, while answering specific questions accurately despite the noisy background noise recorded from a roadshow event.</p><h3>The Road Ahead: Transforming Audio Intelligence</h3><p>While the base Voxtral model did well at the capabilities described above, it is important to note that the current architecture has limitations; it does not yet support <strong>time-aware audio QA</strong> nor <strong>audio scene captioning </strong>that we are interested in as well. Furthermore, the model has not been exposed to Singaporean-accented speech and lacks native support for other local languages such as Mandarin, Bahasa Melayu, and Tamil. Despite these current constraints, the emergence of natively multimodal Spoken Language Models (SLMs) still marks a paradigm shift in how we handle audio data. Beyond simple transcription, this technology serves as a sophisticated force-multiplier for analysts who can now query audio as intuitively as a text document.</p><p>As an R&amp;D team, our goal is to move these capabilities from the lab into the field. We are actively partnering with <strong>HTX product teams</strong> to stress-test this pipeline against real-world conversational AI and audio analytics use cases. These collaborations are vital; user feedback directly informs our iterative refinement of both the model architecture and the deployment pipeline.</p><p>Currently, we are fine-tuning SLMs like <strong>MERaLiON</strong> and <strong>Voxtral</strong> to develop specialised models for the Home Team’s immediate needs. These optimizations are essential to bridging existing linguistic gaps and ensuring our systems are specifically calibrated for unique operational environments.</p><p>Looking ahead, we are moving toward future evolutions that will include full <strong>speech-to-speech (S2S) SLMs</strong> for even lower latency and richer expressive capabilities. Our ultimate objective is the development of <strong>conversational duplex models</strong> — systems that inherently understand the nuances of turn-taking, knowing exactly when to listen and when to speak to provide a truly immersive conversational experience. Stay tuned as we continue to push the boundaries of what’s possible in spoken language modeling!</p><p><em>Many thanks to HTX Language AI Team for giving me the support to build this prototype!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a9399186592" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/beyond-cascaded-pipelines-building-a-native-spoken-language-model-prototype-3a9399186592">Beyond Cascaded Pipelines: Building a Native Spoken Language Model Prototype</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-Time or Wrong-Time: The Messy Reality of Live Transcription]]></title>
            <link>https://medium.com/htx-dsai/real-time-or-wrong-time-the-messy-reality-of-live-transcription-f1890b00f499?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/f1890b00f499</guid>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[local-agreement]]></category>
            <category><![CDATA[alignment-based-agreement]]></category>
            <category><![CDATA[cache-aware]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <dc:creator><![CDATA[Chin Zhuo Sheng]]></dc:creator>
            <pubDate>Mon, 04 May 2026 02:48:00 GMT</pubDate>
            <atom:updated>2026-05-04T02:48:00.313Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>A deep dive into the engineering tradeoffs behind live speech recognition, and the strategies pushing its accuracy to new heights</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8dNzZ_JWYNq3EHA9xirJ6w.jpeg" /><figcaption>Abstract image of audio stream coalescing into data packets, generated by Nano Banana 2.</figcaption></figure><h3>Introduction</h3><p>Live transcription has become increasingly essential in high-stakes environments like the Home Team, where accurate, real-time documentation of interviews and meetings directly affects operational effectiveness and accountability. From police interviews to emergency phone calls, the ability to instantly capture what was said, and said correctly, can be the difference between a solid record and a costly gap.</p><p>The problem is that for years, Automatic Speech Recognition (ASR) systems simply weren’t good enough. Accuracy was a persistent pain point that kept live transcription from seeing widespread adoption, no matter how appealing the concept was in theory.</p><p>That changed in September 2022, when OpenAI released Whisper, a speech transcription model that reignited serious interest in what ASR could become. Since then, the field has exploded: NVIDIA released a series of bird-themed ASR models, Alibaba open-sourced its Qwen ASR lineup, and a wave of new entrants have pushed the boundaries of what’s possible.</p><p>But here’s the catch: most of these models advertise their accuracy on pre-recorded file transcriptions, not live audio. And live transcription is a fundamentally harder problem.</p><h3>Wait… Why Is Live Transcription So Much Harder?</h3><p>When you transcribe a recording, the model gets to hear the whole thing before committing to a word. Live transcription doesn’t have that luxury, it has to make its best guess in real time, with the audio still coming in. Two challenges sit at the heart of this difficulty.</p><p><strong>The Context Problem</strong></p><p>Consider the words “<em>there</em>” and “<em>their</em>.” In a finished recording, a model can resolve the ambiguity easily by reading the full sentence. In a live stream, it may have to commit to one before the rest of the sentence arrives. The model is essentially doing a crossword puzzle where half the clues haven’t been revealed yet.</p><p><strong>The Speed Problem</strong></p><p>Live ASR has to keep up with speech as it happens, which means processing audio at roughly the same pace it’s produced. Models can go back and silently correct earlier guesses as more context arrives, but only if they can do so without falling behind. The moment transcription starts lagging, the whole system becomes useless. And the longer the session runs, the more audio there is to process — which means the system also has to manage its memory carefully to avoid hitting a wall.</p><p>These two constraints, accuracy under uncertainty, and speed under load, are what the following strategies each try to solve, in their own ways.</p><h3>The Strategies: How Different Systems Tackle the Problem</h3><p><strong>Just Buffer Everything (Audio Context Accumulation)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*uJSdCKyBEYHlKZTU.jpg" /></figure><p>The simplest approach: keep a growing buffer of all the audio heard so far, and feed the whole thing to the model every time you want an updated transcript. This is how file-transcription models like Whisper and Qwen3-ASR naturally operate, which makes it easy to adapt them for live use without any architectural changes.</p><p>And because the model always has the full picture, accuracy tends to be excellent, at least at first. The trouble is that the buffer keeps growing. Every update requires the model to reprocess everything from the beginning, and the compute cost climbs accordingly. Eventually, the model hits its context length limit and the buffer has to be reset, often mid-sentence, causing a jarring drop in accuracy. It’s a bit like trying to take notes on a conversation by rewriting your entire notebook from scratch every few seconds, right up until you run out of paper and have to start over.</p><p><strong>Trim as You Go (Local Agreement Algorithm)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1kKLCe1tc_YHmE9oEaANLw.png" /><figcaption>LocalAgreement-2 policy with 1-second update interval. Yellow blocks represent tentative segments still subject to revision, while green blocks have been confirmed across two consecutive inference passes and locked in. Notice the mid-word cutoff “everyone.” is confirmed only after the full word is in the audio buffer. For similar sounding words like “wish” and “wash”, the underlying model can wait for more context before confirmation.</figcaption></figure><p>The <a href="https://arxiv.org/abs/2307.14743">Local Agreement</a> algorithm is an attempt to fix the “rewriting the whole notebook” problem by figuring out which parts of the transcript are settled enough to be locked in and removed from the active buffer.</p><p>It works by running multiple inference passes on overlapping audio windows. When two or three consecutive passes produce identical text for a segment, that segment is considered confirmed and trimmed from the front of the buffer. This keeps the buffer from growing indefinitely and reduces the compute load. It becomes a self-adaptive approach where short buffers handle quick confirmations and longer ones tackle trickier audio. The most common policy is the LocalAgreement-2 policy, where “-2” means that the word is considered confirmed after two consecutive passes.</p><p>The elegance of the approach is that it tries to solve both the context explosion and the mid-word cutoff problems at once. The limitation is that “confirmed” doesn’t always mean “final”. If a segment gets locked in mid-sentence, the remaining sentence loses its earlier context, which can trip up sequence-to-sequence models like Whisper. Strip away too much context, and you can start seeing hallucinations where the model fills gaps with plausible but incorrect text.</p><p><strong>Let the Model Decide When to Speak (Alignment-based Attention)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*a1rus-xtiQmIhPFLvUxrRA.png" /><figcaption>Taken from SimulWhisper paper. Different colours indicate different audio chunks and their corresponding transcriptions. Darker blocks in the cross-attention matrix indicate the audio frames most attended to by the current token. Upper part: De-coding is stopped when the most attended audio frame appears at the chunk boundary. Lower part: The unreliable last word is deleted from the transcription when truncation is detected and the model waits until the next chunk is received.</figcaption></figure><p>Rather than engineering buffer rules from the outside, Alignment-based Attention (AlignAtt) asks a more interesting question: what if the model itself could signal when it’s confident enough to emit a transcript?</p><p>It turns out that attention mechanisms in transformer-based models like Whisper implicitly encode timing information. The weights reveal which audio frames the model is focusing on when generating each output token. AlignAtt exploits these patterns to determine when it’s safe to release a partial transcript, without waiting for a full buffer to accumulate. Crucially, this approach is only applicable to transformer-based architectures. Models that don’t use attention mechanisms simply don’t have this internal signal to tap into, which makes AlignAtt a powerful but inherently model-specific tool.</p><p>The result is a system that can begin producing output mid-utterance, releasing transcript chunks as the attention patterns indicate sufficient audio evidence. Systems like <a href="http://docs.nvidia.com/nemo-framework/user-guide/latest/nemotoolkit/asr/streaming_decoding/canary_chunked_and_streaming_decoding.html">Canary</a> and <a href="http://arxiv.org/abs/2406.10052">SimulWhisper</a> apply this idea to multilingual and simultaneous speech translation settings, where adaptive latency is especially valuable.</p><p>The appeal is that this approach doesn’t require purpose-built streaming architectures. It repurposes what offline transformer models already know. The tradeoff is that it’s only as reliable as the underlying attention alignment, which can become shaky in noisy environments or with speech patterns the model hasn’t seen much of.</p><p><strong>Remember What You’ve Already Heard (Cache-Aware Streaming)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ILqvtthsQw-8KOpk.png" /><figcaption><em>The streaming ASR architecture utilizing a Cache Aware Conformer Encoder and a context manager to maintain encoder states without redundant computation.</em></figcaption></figure><p><a href="http://huggingface.co/blog/nvidia/nemotron-speech-asr-scaling-voice-agents">Cache-aware streaming</a> is the most architecturally ambitious of the four approaches and, in high-throughput environments, arguably the most powerful.</p><p>The core idea: instead of reprocessing overlapping audio windows every update, the model stores its internal encoder states from previous chunks in a cache. When new audio arrives, only the fresh frames need to be processed; the cached states carry forward everything the model already computed. Each frame is processed exactly once.</p><p>Think of it as the difference between re-reading an entire book every time you want to remember a plot point, versus keeping detailed chapter notes that you simply update as you read on.</p><p>Pioneered in NVIDIA’s FastConformer and Nemotron Speech models, this approach has some striking performance characteristics. Because the compute cost per chunk stays constant regardless of session length, latency doesn’t drift over time. This is a critical advantage for long-running sessions. Memory usage is also stable, enabling hundreds of simultaneous streams on a single GPU. Chunk sizes can even be tuned at inference time to trade off latency against accuracy, without any retraining required.</p><p>The catch is that cache-aware streaming requires models to be designed for it from the ground up. You can’t simply take Whisper and bolt on a caching layer, which limits how readily this approach can be adopted without investing in purpose-built infrastructure.</p><p>The various strategies are summarized below:</p><iframe src="https://flo.uri.sh/visualisation/28092716/embed" width="700" height="575" frameborder="0" scrolling="no"><a href="https://medium.com/media/defa3df9d9ec267af4defabe9b9f90cb/href">https://medium.com/media/defa3df9d9ec267af4defabe9b9f90cb/href</a></iframe><h3>So Which One Is Right?</h3><p>Each strategy represents a different answer to the same underlying tension: you can have accuracy, speed, or simplicity, but optimising for all three at once remains an open challenge.</p><p>Audio context accumulation is the easiest to implement and delivers the highest fidelity, making it well-suited for shorter, bounded sessions where compute costs don’t spiral. Local Agreement extends that usability window by managing the buffer more intelligently, at the cost of some robustness at segment boundaries. AlignAtt opens up streaming to a broader range of pretrained models without major architectural changes, while cache-aware streaming sets the benchmark for production-grade deployments where throughput and consistency matter most.</p><p>However, improving live transcription is not just about streaming strategies. It also depends heavily on adapting models to real-world conditions. For example, fine-tuning Whisper can significantly improve transcription quality in operational settings, as discussed in <a href="https://medium.com/htx-dsai/finetuning-whisper-for-the-singaporean-home-team-context-a3ae1a6ae809"><strong>Finetuning Whisper for the Singaporean Home Team Context</strong></a>.</p><p>For a context like the Home Team, where audio conditions can vary widely, there’s no one-size-fits-all answer. But as the ASR ecosystem continues to mature, the gap between what’s possible in a recording studio and what works in the field is closing faster than ever.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1890b00f499" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/real-time-or-wrong-time-the-messy-reality-of-live-transcription-f1890b00f499">Real-Time or Wrong-Time: The Messy Reality of Live Transcription</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does Data Augmentation Improve Deepfake Audio Detector Training?]]></title>
            <link>https://medium.com/htx-dsai/does-data-augmentation-improve-deepfake-audio-detector-training-ba2934bcc94d?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/ba2934bcc94d</guid>
            <category><![CDATA[ai-governance]]></category>
            <category><![CDATA[data-augmentation]]></category>
            <category><![CDATA[deepfake-detection]]></category>
            <category><![CDATA[audio-signal-processing]]></category>
            <dc:creator><![CDATA[Liu Yucen]]></dc:creator>
            <pubDate>Thu, 26 Mar 2026 03:04:51 GMT</pubDate>
            <atom:updated>2026-03-26T03:04:49.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8naUDkXkeaElVfAc4imWA.png" /><figcaption>Deepfake audio of prominent figures are common</figcaption></figure><p>Hi everyone,</p><p>I’m Yucen, currently a pre-university intern at HTX xData. I’ve recently completed my National Service, and wished to do something meaningful with the free time I had until the start of university. As I did some self-studying on Machine Learning during my time in National Service, xData was an ideal place for me to put that knowledge to use by partaking in real-life projects.</p><p><strong>What are Deepfake Audios (DFAs)?</strong></p><p>The increasing sophistication of scams nowadays reflects the rapid adoption of new technologies by scammers worldwide. Deepfake audios (DFAs) usually involve using algorithms to generate speech resembling that of a real person’s, often with the goal to impersonate one party and deceive another.</p><p>An <a href="https://www.nbcnews.com/politics/2024-election/fake-joe-biden-robocall-tells-new-hampshire-democrats-not-vote-tuesday-rcna134984">infamous example</a> involved a call purportedly originating from then-US President Biden, encouraging voters to not vote in the 2024 New Hampshire Democratic primary. In reality, this was a robocall using DFA technology to mimic his voice, in a striking example of such technology being used in electoral interference.</p><blockquote>“Creating the fake audio (of Biden) took less than 20 minutes and cost only $1, he said, for which he was paid $150.”</blockquote><p>Another incident involved former PM Lee Hsien Loong, where an audio and video deepfake of him surfaced in 2024, promoting a fraudulent investment scheme. It is hence obvious that DFA technology poses an insidious problem for societies today, and that training good DFA detectors should be a priority.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGkF_qckOCqJX-4JLJFK-A.png" /><figcaption>Another <a href="https://www.straitstimes.com/singapore/sm-lee-warns-that-video-of-him-promoting-an-investment-scam-on-social-media-is-a-deepfake">example</a> illustrating the potentially devastating effects of DFAs</figcaption></figure><p><strong>What is Data Augmentation?</strong></p><p>Remember the term “Data Augmentation” mentioned in the title? What relevance does it have to training a DFA detector?</p><p>Data augmentation involves generating of modified copies of the original data, by artificially applying transformations. For example, we may rotate an image by 90 degrees, or add background noises to an audio clip. It is a powerful technique in situations where the original dataset is limited in quantity or variety. By improving a training dataset in these respects, a more generalised DFA detector model, capable of performing better in novel situations, can be trained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ct82PMztv5WgeaPA.png" /><figcaption>Example of audio data augmentation: The pitch of the original audio is shifted here.</figcaption></figure><p>Many past research on DFA detection have also played around with them. However, such research are not localised to the Singaporean context.</p><p><strong>Experimental Objective &amp; Data Used</strong></p><p>With these in mind, I decided to study the impact of data augmentation on DFA detector training. I will train multiple models with different augmented training sets and compare it against a model trained on an unaugmented training set, searching for improvements in model performance.</p><p>Many past research have played around with various augmentation techniques when training DFA detectors. However, there is a crucial research gap — such research did not focus on Singaporean speech, which has its own unique characteristics. DFA detectors look for specific deepfake artefacts, but a Singaporean accent generates unique audio waveforms, which combined with the waveforms of deepfake artefacts may confuse the detector. This influenced the selection of datasets used in this research, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDAhzobgGyu1mxC6TJyDjQ.png" /><figcaption>Datasets used</figcaption></figure><p><a href="https://arxiv.org/abs/2408.08739">ASVSpoof5</a> (Automatic Speaker Verification) is the fifth edition in a series of challenges that promote the study of speech spoofing and deepfake attacks, and a commonly used dataset for many DFA research I came across. HTX Internal eval is an internally curated dataset composed of Singapore-accented DFA prepared by our data scientists, whilst In-the-Wild contains various public figures’ speeches from various public platforms (YouTube, TikTok, etc). The SGSpoof dataset addresses the current research gap mentioned above, whereas the other datasets provide variety.</p><p><strong>Model architecture</strong></p><p>The DFA detector model architecture used in this experiment takes very heavy inspiration from <a href="https://openreview.net/pdf?id=acJMIXJg2u">this paper</a>. The input is first passed through several convolutional layers, before being passed into a transformer encoder. Finally, several feed forward neural network layers acting as classifiers output a binary classification.</p><p><strong>Experimental Plan</strong></p><p>The experiment is broken down into 2 stages. The first stage involves testing various augmentation techniques standalone, whilst the second stage involves combining some augmentations in stage 1. The models are trained and then compared to the baseline performance, where baseline performance refers to model performance when no data augmentation was used during training.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2ghceUMNGRjOy83ueR9XA.png" /><figcaption>Stage 1 of experiment</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sr86H6sxGvwrK_0T2yDrkA.png" /><figcaption>Stage 2 of experiment</figcaption></figure><p>The evaluation is done on all 3 evaluation sets shown in the previous section, and the metric of Equal Error Rate (EER) is used. EER is the point where acceptance error and rejection error rates are equal. Hence, a lower EER indicates better model performance.</p><p>A couple of things to note before we move on. Firstly, the development (which we use to monitor validation loss for early stopping) and evaluation sets are not augmented. Secondly, in stage 2, only 2 augmentations are combined.</p><p><strong>Augmentation Methods</strong></p><p>7 augmentation methods were tested in stage 1. They are:</p><ul><li><strong>Aliasing</strong> — Distortions are created during audio downsampling process. You can read up more about this phenomenon <a href="https://producelikeapro.com/blog/digital-audio-basics-aliasing-explained/">here</a>.</li><li><strong>Background noises — </strong>Adds sounds present in daily life (cars, rain, etc.)</li><li><strong>Codec</strong> — Refers to changing audio file type between different file formats (.wav, .mp3, etc)</li><li><strong>Frequency Band Masking</strong> — Some bands of frequencies are removed</li><li><strong>Rawboost — </strong>Adds background static noise</li><li><strong>Room Impulse Response (RIR) </strong>— Simulates room echoes</li><li><strong>Shuffling</strong> — Audio is broken down into 0.4s chunks and shuffled</li></ul><p>Some of these augmentations simulate real sound conditions that exist in daily life, such as <em>RIR </em>which<em> </em>simulates echoes present in audio recorded in a room. Others, like S<em>huffling</em> or<em> Band Masking</em>, do not occur in daily life, but present great potential as synthetic modifications to audio data. You can see the spectrogram and listen to these augmentations below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*o89v9REkpzLTQl2J00rqgw.png" /><figcaption>Spectrograms of the 7 augmentations vs original</figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261947397%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Foriginal%3Fsi%3D57fd1225e8db438d9eea76cb4f85cf36%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6bb6c474b7eb455756613a99ffcae27/href">https://medium.com/media/e6bb6c474b7eb455756613a99ffcae27/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261949488%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Fcoughing-background%3Fsi%3D1378beb768684118a707438625ff531f%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/48081741ac25a7014ce9310fb5d8acc3/href">https://medium.com/media/48081741ac25a7014ce9310fb5d8acc3/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261944991%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Faliasing%3Fsi%3D36f1f7e7e80745a28f701e096593c327%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/f0e2a25411336812fadd4aadc833a2bb/href">https://medium.com/media/f0e2a25411336812fadd4aadc833a2bb/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261948855%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Fcodec%3Fsi%3D38d2a966b8f2477c9d68026850e548d0%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/f30f2a87b5b9c531d62cd1734ef34dde/href">https://medium.com/media/f30f2a87b5b9c531d62cd1734ef34dde/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261949041%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Fband-masking%3Fsi%3D4d7eb56065ee4ae29bd32a318ad5d66f%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/6be998608725d7337934406ff8ad1807/href">https://medium.com/media/6be998608725d7337934406ff8ad1807/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261949983%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Frawboost%3Fsi%3D917c4e0d55ca4bee9842cf7700caa2ab%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ed09088cddcbc9a5772b45c2ae0e678/href">https://medium.com/media/0ed09088cddcbc9a5772b45c2ae0e678/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261950538%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Frir%3Fsi%3Df374ca6f5e3e4bc5a219e3aa55d12266%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2041bb2bd8da600689fe6a0e755e6ff/href">https://medium.com/media/f2041bb2bd8da600689fe6a0e755e6ff/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2261950880%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Flyc-387439663%2Fshuffling%3Fsi%3D80be9b0bad0345faad42fa10d220bc30%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f0ac65087f79820a625a2bcfaca5b9e/href">https://medium.com/media/3f0ac65087f79820a625a2bcfaca5b9e/href</a></iframe><p><strong>Results and insights</strong></p><p>After a few weeks dedicated to training, I obtained the following results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L7AiL22Kv2f11DrPZLni1w.png" /><figcaption>EER results obtained for various augmentation methods</figcaption></figure><p><em>Original</em> refers to the model trained on unaugmented data. A dash in an augmentation method denotes compound augmentations. For example, <em>Rawboost-Codec</em> refers to both <em>Rawboost</em> and <em>Codec</em> being applied. The red diamonds refer to the average EER values of each standalone augmentation method, with blue diamonds indicating compound augmentations.</p><p>There are 4 main conclusions that can be drawn here:</p><ul><li>Augmentations generally improve model performance.</li><li>The best performing augmentation is <em>RIR</em>, with a 14.53% EER, followed closely by <em>Codec</em> and <em>Masking</em>, with both attaining 14.77% EER. This suggests that these augmentations likely simulate the greatest hurdles for DFA detectors of similar architecture.</li><li>There is not enough evidence that compounding augmentations leads to improvements in performance. In this experiment, all compound augmentation-trained models performed no better than models trained on their individual constituents.</li></ul><p>Overall, the results did match my expectations — Augmentations are a tried and tested method for improving model training, and they certainly did not disappoint here.</p><p><strong>Conclusion</strong></p><p>With that, both my internship at HTX and experimentation came to an end. Should time have permitted, it would have been interesting to test out various other model architectures, and toying around with model ensembles might have led to even greater performances in EERs as well.</p><p>Many thanks to my supervisor Fwu Chyi for his guidance throughout my time here, and for putting up with my nonsensical questions at time. He and the xData team were really helpful and welcoming towards me and the other fellow interns, it was truly enjoyable being part of this team for the past few months!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba2934bcc94d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/does-data-augmentation-improve-deepfake-audio-detector-training-ba2934bcc94d">Does Data Augmentation Improve Deepfake Audio Detector Training?</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Speech-To-Text — Towards more robust and informative ASR by increasing transcription…]]></title>
            <link>https://medium.com/htx-dsai/beyond-speech-to-text-towards-more-robust-and-informative-asr-by-increasing-transcription-08f8f2eee9e9?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/08f8f2eee9e9</guid>
            <category><![CDATA[text-to-speech]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[signal-processing]]></category>
            <category><![CDATA[speaker-diarization]]></category>
            <dc:creator><![CDATA[Teo Yoke Sheng Clifton]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 01:20:54 GMT</pubDate>
            <atom:updated>2026-03-17T01:20:52.510Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Beyond Speech-To-Text — Towards more robust and informative ASR by increasing transcription readability</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*CCq50HJHlzvi5LIa4Z1_aA.png" /></figure><p>Hello! I am Clifton, from the Language AI R&amp;D Team within the Home Team Science and Technology Agency (HTX), and today I will be writing about my work here in HTX, mostly focusing on Speech AI and research contributing to more robust Automatic Speech recognition (ASR)! ASR technology is increasingly rampant, chances are if you watch Youtube, you would have seen automatic captions being generated — a feature that has been in place since 2009 that drastically improved following the AI wave.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CZMgwJl5peVYNsVdZFY5Kg.png" /><figcaption>Automatic captions can be easily generated</figcaption></figure><p>Though ASR has essentially plateaued in performance (Word Error Rate or WER) for high resource languages (extensible to lower resource languages/accents via finetuning given enough data — refer to our medium article <a href="https://medium.com/htx-dsai/finetuning-whisper-for-the-singaporean-home-team-context-a3ae1a6ae809">here</a> to see how we did so for the Singaporean context), there are still many areas of speech research that can push ASR to the next level:</p><ul><li>Text can be aligned in time (i.e. CTC/forced alignment) to obtain timestamp for subtitles or to search audio for words of interest</li><li>Speech recognition can be done for multiple languages at once (multilingual code switching)</li><li>Speaker information can be extracted to determine who spoke what when (i.e. diarisation)</li><li>Prosodic information can be analysed to examine emotive states of speakers</li><li>Sources in an audio stream can be separated</li><li>And so on…</li></ul><p>With so many possible topics to explore in the ASR realm, it may be quite difficult to determine the next steps, and what to research into — every topic can provide tangible improvements to pipelines leveraging ASR. In the end, we chose to do improvements to the pipeline incrementally, building up important foundations via better alignment of transcription (e.g. digit to spoken numbers), software and hardware diarisation, speaker enrolment, and constant incremental improvements to our finetuning pipeline. These areas of work would strengthen the foundations of our team’s pipeline by providing better readability to ASR transcriptions.</p><h3><strong>What to improve in ASR</strong></h3><p>Our existing Whisper-based framework was already performing ASR for Singaporean speech with diarisation, that is closely mimicking the <a href="https://github.com/m-bain/whisperX">WhisperX</a> pipeline (i.e. Whisper — Wav2Vec2 Forced Alignment — Pyannote Speaker Diarisation) and yielding decent performance. How else do we then improve our ASR pipeline? We started by exposing some of the problems that we faced when building up our ASR pipeline:</p><p><strong>Problem 1 — Word Error Rate (WER) does not give the full picture</strong></p><p>Finetuning Whisper on <a href="https://www.imda.gov.sg/how-we-can-help/national-speech-corpus">IMDA NSC</a> part 3 did give transcription a boost in accuracy performance (or a drop in WER) for Singaporean English. However, Whisper’s original pre-training corpus contains a large amount of web data, which contributed to hallucinated transcription on learned patterns that may not correspond to actual audio. Consequently, even though WER has dropped in the large part, when it matters, hallucinated output not only inflates WER but also result in reduction in readability and reliability of transcripts. A few examples of harmful hallucinations are given in the table below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*7_nxb1O2u6wDBeHp" /><figcaption>Potential hallucination encountered using Whisper</figcaption></figure><p><strong>Problem 2 — Written forms of numbers does not align well with speech</strong></p><p>When spoken, numbers differ greatly from their written representation. Take “5556 — Five thousand five hundred and fifty six” for example; generating it via ASR may lead to “5000 500 and 56”. This creates two sub problems for us:</p><ol><li>Obtaining numerical digit output requires careful consideration — The boundaries of speech for each utterance of a number cannot be clearly defined. (For example, for <strong><em>Five thousand five hundred and fifty six,</em> </strong>“5556” and “5500, and 56” could both be valid utterances within a sentence.)</li><li><a href="https://docs.pytorch.org/audio/stable/tutorials/forced_alignment_tutorial.html">Forced alignment</a> fails when digits are generated — Timestamp information of digits cannot be reliably obtained as forced alignment expects <strong>zero</strong> <strong>ambiguity</strong> in speech and transcription pairs, whereas one written form of a number has multiple spoken forms. “5556” can be interpreted as any of the following:</li></ol><blockquote>five thousand five hundred and fifty six</blockquote><blockquote>five thousand five hundred fifty six</blockquote><blockquote>five five five six</blockquote><p>Thus, some form of processing is required for alignment to work, and to obtain the desired output (in this case, digits only).</p><p><strong>Problem 3 — Online speaker diarisation struggles with speech in Singaporean meetings</strong></p><p>Online speaker diarisation refers to the case of multiple speaker speech being streamed in real time, and the attempt to label <em>who spoke what, when. </em>This is challenging as Singaporeans typically speak with frequent interruptions and a fast pace of speech. This phenomenon is illustrated in the timestamped transcript below.</p><blockquote><strong>00:00:01.354 -&gt; 00:00:03.547</strong> &lt;<strong>Speaker 1&gt;: </strong>Another speaker speaks quickly after me</blockquote><blockquote>0<strong>0:00:03.625 -&gt; 00:00:06.142</strong> &lt;<strong>Speaker 2&gt;: </strong>Which is encountered often during discussi — <strong>[Interuption/overlap] - </strong>ons</blockquote><blockquote><strong>00:00:06.052 -&gt; 00:00:08.651 &lt;Speaker 1&gt;: </strong>With occasional interruptions as well</blockquote><p>This makes online speaker diarisation difficult to do with high accuracy as speaker segments belonging to different speakers will not have a well-defined border.</p><h3><strong>Enhancing ASR via Research and Engineering</strong></h3><h4>Engineering hallucinations away</h4><p>When our existing research is not yet able to reliably solve issues (such as hallucination), our AI-Engineering team (led by <a href="https://medium.com/u/05ae7782b2c0">Chin Zhuo Sheng</a>) harnesses raw engineering prowess instead. The team came up with the idea of comparing Whisper’s transcription against Wav2Vec2’s during streaming inference, which is much more reliable due to the differences in objectives of the two models:</p><ul><li>Wav2Vec2 being more focused on outputting phone labels and using CTC loss to align these labels to words.</li><li>Whisper looking across a 30 seconds chunk of audio to output speech features for its decoder to reference, in addition to previous text tokens, to autoregressively generate text tokens. The flawed data during pre-training + decoding process is likely what causes the hallucination problem</li></ul><p>By flagging severe differences in transcription, hallucination can be “caught” and removed.</p><h4>Enhancing readability by eliminating written numbers in transcription</h4><p>Finetuning whisper to transcribe Singaporean speech well, unfortunately for us, made generated transcripts more likely to output written numbers, due to the formatting of the transcripts that we use as our training data. We explored a few solutions:</p><ol><li>The quickest and easiest way to eliminate this was by suppressing numerals.</li><li>We also explored prompting whisper to nudge it to transcribe in alphabetical spoken form as well, which helped further reduce written number output.</li><li>We also post processed the transcript to convert alphabetical spoken forms to formats that are more easily readable to align better with what our users want.</li></ol><p>These “fixes” can be found in the code chunk below:</p><pre>import whisperx<br><br>whisper_prompt = &quot;The following audio contains expressions of quantity and measurement<br>that should be represented as spelled-out words rather than symbols.<br>Ensure all original marks of punctuation and indicators of emphasis,<br>such as capital letters, are faithfully maintained throughout the<br>transcription. For instance, a quantity of items should appear as<br>&#39;ten units&#39; not &#39;one zero units&#39;. A monetary value should be &#39;twenty dollars&#39;<br>instead of &#39;two zero dollars&#39;. A chronological indication should be<br>&#39;nineteen ninety-nine&#39; instead of &#39;one nine nine nine&#39;. Preserve specific<br>formatting like &#39;P.O. Box&#39; or similar constructs. The aim is for completely<br>textual representations of all numerical concepts.&quot;<br><br>whisperx.load_model(<br>        &quot;large-v2&quot;,<br>        device,<br>        compute_type=compute_type,<br>        language=language,<br>        asr_options={<br>            &quot;beam_size&quot;: 5,<br>            &quot;suppress_numerals&quot;: True,<br>            &quot;initial_prompt&quot;: whisper_prompt,<br>            &quot;length_penalty&quot;: 1.0,<br>        },<br>    )</pre><p>This is of course not the only, or “best” solution to this problem as others have also explored using LLMs or end-to-end models to post process the transcription instead.</p><h4><strong>Diarisation (Software)</strong></h4><p>Before we discuss more on the solutions we explored for online speaker diarisation (or streaming/real time diarisation), let’s go through a very quick crash course on diarisation. To summarise, diarisation is simply the task of determining who spoke what, when. Diarisation typically refers to <em>software diarisation</em>, whereby an audio clip is passed through a pipeline which:</p><p>1) Detects speech segment and the timestamps via <strong>Voice Activity Detection (VAD)</strong></p><p>2) Determines if there are speaker switches within these segments via <strong>Speaker Segmentation</strong></p><p>3) Clusters speech segment embeddings based on some form of similarity metric (eg. <em>cosine similarity</em>)</p><p>The metric we use to evaluate diarisation performance is the Diarisation Error Rate (DER):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*bD_x7_qypill0ilU.png" /><figcaption>Calculating Diarisation Error Rate (DER)</figcaption></figure><p>DER is calculated by adding up errors arising from the following:</p><ul><li><strong>False Alarm — </strong>Non speech segments incorrectly assigned to a speaker in green</li><li><strong>Missed Detection — </strong>Speech segments spoken by a speaker, but is not assigned to any speakers</li><li><strong>Speaker Confusion — </strong>Speech segments incorrectly assigned to the wrong speaker</li></ul><p>and dividing by the total length of speech. The key thing to take note here is that <strong>two out of three components</strong> of DER (False Alarm and Missed Detection) are highly dependent on whether voice activity is detected properly. Thus, the key component that we chose to focus on is Speaker Confusion<strong>,</strong> as it affects user friendliness of transcription by the margin. Just imagine reading an interview excerpt that consistently labels the interviewer as the interviewee and vice versa, where labeling either speakers for each speech segments would still make sense:</p><blockquote>Interviewer (correctly labelled): What about the weather? Singapore‘s weather has been very volatile lately.</blockquote><blockquote>Interviewee (wrongly labelled): I was actually going to try cycling to work but it started to pour, so I scrapped that thought.</blockquote><blockquote>Interviewer (wrongly labelled) : Oh yes, this January’s rainfall is actually a record high for singapore!</blockquote><p>That being said, we cannot simply forgo the other two components and solely focus on Speaker Confusion. For example, Speaker Confusion can effectively be zero when Missed Detection is 100%, which may happen in cases like overly noisy audio with loud background noises, which makes it hard for VAD to be reliable.</p><p>Some popular open sourced diarisation frameworks available today include the use of <a href="https://github.com/snakers4/silero-vad">Silero VAD</a> for streaming voice activity detection, and <a href="https://huggingface.co/pyannote/speaker-diarization-community-1">Pyannote</a> for the segmentation and embedding models. In our testing, diarisation performance is generally decent across multiple frameworks for batch diarisation, but performance is lacking in live settings.</p><p><strong>Issues faced during live diarisation (and transcription)</strong></p><p>Live transcription and diarisation has two key differences from batch:</p><ol><li>Batch processing allows both transcription and diarisation models to observe (up to) the full audio length, which allows for better modelling of speaker features, as well as improved segmentation and clustering performance</li><li>To retain the speed of live transcription, speaker embeddings would need to be formed at the start to provide a point of comparison to newly embedded speech, which can either be from new speakers or previously encountered speakers. These embeddings are referred to as speaker attractors. Misclassifications (that may arise from a segment containing overlapping speech, or successive speaker speech) during inference will contribute to performance degradations due to erroneous updates to these speaker attractors, leading to even more misclassifications.</li></ol><p>Several frameworks then aim to improve live diarisation performance:</p><p><a href="https://github.com/juanmc2005/diart"><em>Diart</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*KjoF6cUPdflpRErFvBHjkw.png" /><figcaption>Diart — Real time segmentation of speech, and update of speaker attractors after initialization, with Overlap aware capabilities</figcaption></figure><p>Diart is a diarisation framework that does not assume an upper bound to the number of speakers, directly outputting multi-speaker activity within a rolling audio buffer, which is compared against (constantly updated) speaker embeddings of speakers encountered thus far. There is an initial latency of 5 seconds to initialize global speaker embeddings before it is used to compare against the rolling buffer of locally segmented speech embeddings, which will then be clustered and compared against the global speaker embeddings.</p><p><a href="https://huggingface.co/nvidia/diar_streaming_sortformer_4spk-v2"><em>Sortformer v2</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*EHVqKxQrmSqGZGtDaL5V6Q.png" /><figcaption>Sortformer — Indexing speakers strictly based on arrival time via sort loss and Arrival Order Speaker Cache</figcaption></figure><p>Sortformer introduces sort loss, where speakers are indexed based on arrival timing, such that prediction will always align with this ordering. It also introduces an Arrival Order Speaker Cache (AOSC) which stores speaker embeddings in order of arrival, with new speakers being appended as a new index. Speech from previous speakers will be appended to their earlier segments in their respective index within the AOSC.</p><p>However, from real-world testing, live diarisation still only performs well when there are clearly defined pauses in between speaker speech since misclassifications during inference deteriorates performance relatively quickly as speaker attractors will be updated with these errors as well.</p><p><strong>Solving the speaker attractor problem</strong></p><p>A quick solution to bypass badly modelled speaker attractors would be to collect clean speech from speakers before a meeting, using them as the ground truth embeddings for computing similarities (commonly <strong>cosine similarity</strong>) between newly detected speech within a meeting recording against all the embeddings in a process otherwise known as <em>speaker identification</em>. The speaker label is then returned:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*ffEAdXuvleMfYVaolcXi3w.png" /></figure><p>The key disadvantage via this approach is the need for meeting attendees to record clean audio that is ideally phonetically balanced (see <a href="https://en.wikipedia.org/wiki/Harvard_sentences">Harvard Sentences</a> for an example), and similar to their conversational style for reference speech embeddings to be accurate during inference.</p><h4><strong>Other approaches to diarisation </strong>(Hardware)<strong> to explore</strong></h4><p>Diarisation (Software) may be a difficult task, but having multiple channels of audio simplifies the problem slightly by providing us with spatial information to work with. Spatial information arises from the way sound is propagated — sound waves travel at approximately 343m/s, meaning that any given microphone pair in a multi-channel recording set up will pick up the sound at different timings, frequency spectrums, and amplitudes. With these information at hand, <em>Direction Of Arrival</em> (<strong>DOA</strong>) can then be estimated. The following approaches are some of the methods that can estimate DOA:</p><p><strong>Subspace based</strong></p><p>These methods aim to separate audio signals into signal (information of the sources) and noise subspaces (in ideal cases, containing no source information), and through the assumption of <strong>source signals being uncorrelated</strong> and <strong>number of sensors &gt;= number of sources</strong>, attempt to determine the DOA.</p><p><strong>Time Delay Of Arrival</strong></p><p>These methods attempt to estimate difference in time needed for source(s) to travel to each microphones assuming that there is one dominant path it travels by. The estimation is done by finding peaks where signals match at the estimated time delay</p><blockquote>Mic1’s signal @ time 1 <strong>≈</strong> Mic2’s signal @ (time 1 + delay)</blockquote><p>With more than two microphones, using the estimated delays between all microphone pairs can then point us in an approximate DOA. With only two microphones, sources located equidistant from the two microphones, can be located on either side perpendicular to the center of the microphone pair. But with just one more microphone added, this eliminates this ambiguity. The DOA is calculated using distance between microphone pairs (d), speed of sound (c), time delay (t):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*F6q28cGvaB3drFDaJvjz2A.png" /><figcaption>Formula for obtaining the angle of arrival</figcaption></figure><p><strong>Neural Networks</strong></p><p>Given enough similar data to actual deployment set-ups, and if training data does not differ from what will be recorded during meetings, Neural Networks can do very well for DOA estimation. It can inherently circumvent problems <strong><em>phased </em></strong>(pun intended) by other methods, like overlapping speech, reverberation, meaningless but constant background noise by learning directly from training data how to deal with these without needing additional specialized components such as speech enhancement and overlapped speech detection. However, the assumption of training data <strong>closely matching </strong>(Distance of source from microphone array, background noise volume and type, speaker locations relative to array, etc.) meeting recordings must be met, otherwise performance degrades much faster than other methods.</p><p>These are just a few topics to explore further. There are many other ways that diarisation can be achieved (<em>Audio-Visual speaker diarisation</em>,<em> isolating speaker audio streams </em>etc.) — still, these do provide a wide enough base for us to dive deeper into strengthening our diarisation capabilities!</p><h4><strong>Concluding thoughts</strong></h4><p>ASR already provides a big quality of life improvement, with many direct applications. There are however many components of an ASR pipeline to improve upon, to truly push the usefulness of ASR systems to the next level, as with all AI systems. Do subscribe to our medium page and anticipate the many other topics we will explore in the near future — these may well span beyond building robust ASR pipelines!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08f8f2eee9e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/beyond-speech-to-text-towards-more-robust-and-informative-asr-by-increasing-transcription-08f8f2eee9e9">Beyond Speech-To-Text — Towards more robust and informative ASR by increasing transcription…</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Joined an AI Safety Bootcamp — Here’s What I learnt]]></title>
            <link>https://medium.com/htx-dsai/i-joined-an-ai-safety-bootcamp-heres-what-i-learnt-6780d335e26d?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/6780d335e26d</guid>
            <category><![CDATA[ai-safety]]></category>
            <category><![CDATA[equitable-ai]]></category>
            <category><![CDATA[ai-governance]]></category>
            <category><![CDATA[ai-testing-framework]]></category>
            <category><![CDATA[regulation]]></category>
            <dc:creator><![CDATA[Teo Fwu Chyi]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 01:38:11 GMT</pubDate>
            <atom:updated>2026-01-05T01:42:11.019Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Joined an AI Safety Bootcamp — Here’s What I learnt</h3><p>Here comes another AI story in your feed, but maybe that’s exactly why AI safety deserves more attention. Between deepfake scams where <a href="https://edition.cnn.com/2024/02/04/asia/deepfake-cfo-scam-hong-kong-intl-hnk">CEOs are impersonated</a> and <a href="https://www.cell.com/patterns/fulltext/S2666-3899(24)00103-X?ref=aiexec.whitegloveai.com">AI systems exhibiting deceptive behavior</a>, it’s clear that we can no longer ignore the growing impact of AI. To better understand the risks, I joined an AI safety bootcamp last year, organized by <a href="https://www.ml4good.org/thebootcamp">ML4Good</a> — a project by the <a href="https://www.securite-ia.fr/en">French Center for AI Safety (CeSIA)</a> that runs intensive programs covering the AI safety landscape, governance, and technical methods — and the <a href="https://www.aisafety.sg/">Singapore AI Safety Hub (SASH)</a>, a community and co-working space for people working on or curious about AI safety. I will do my best to break down some of what I’ve learned and give an overview of this complex field.</p><p>For those interested in a deeper dive, the <a href="https://ai-safety-atlas.com/chapters">AI Safety Atlas textbook</a> provides a thorough and accessible introduction. Published by CeSIA, the textbook aims to:</p><blockquote>… create educational infrastructure that accelerates AI safety progress by enabling better-trained practitioners and improved coordination across the field.</blockquote><p>Much of the material in this article draws on this textbook, which is widely used in <a href="https://ai-safety-atlas.com/courses">AI safety courses</a> around the world. Throughout, I will explore some of the major questions in AI safety, including:</p><ul><li><a href="#1bd5">Is AI safety a global priority?</a></li><li><a href="#296d">Why should we be concerned, and how fast is AI really advancing?</a></li><li><a href="#e399">How do we think about AI risks?</a></li><li><a href="#3852">How can we protect ourselves?</a></li><li><a href="#fc80">What’s being done so far on the governance front?</a></li><li><a href="#ea72">What role does Singapore play in regional and global AI safety?</a></li></ul><h3>Is AI safety a global priority?</h3><p>Yes! The global community is increasingly voicing its concerns about AI governance through statements like:</p><ol><li>The <a href="https://aistatement.com/#open-letter">AI extinction Statement</a><strong> </strong>released by the Center of AI Safety states:</li></ol><blockquote>Mitigating the risk of extinction from AI should be a global priority alongside other societal-scale risks such as pandemics and nuclear war</blockquote><p>Signatories of the statement include: “godfathers of AI” Geoffrey Hinton and Yoshua Bengio, CEO of OpenAI Sam Altman, CEO of Anthropic Dario Amodei, billionaire philanthropist Bill Gates, and more.</p><p>2. The <a href="https://www.gov.uk/government/publications/ai-safety-summit-2023-the-bletchley-declaration/the-bletchley-declaration-by-countries-attending-the-ai-safety-summit-1-2-november-2023">Bletchley Declaration</a> (AI Safety Summit 2023) — 28 countries + EU came together to commit to cooperating on:</p><blockquote>… Identifying AI safety risks of shared concern, building a shared scientific and evidence-based understanding of these risks, and sustaining that understanding as capabilities continue to increase, in the context of a wider global approach to understanding the impact of AI in our societies.</blockquote><p>3. <a href="https://www.gov.cn/yaowen/liebiao/202407/content_6961358.htm">Shanghai Declaration on Global AI Governance</a> (English translation <a href="http://www.catl.org.cn/2024-07/05/content_117293306.html">here</a>) calls for global cooperation to:</p><blockquote>… promote the development and application of AI technologies while ensuring safety, reliability, controllability and fairness in the process, and encourage leveraging AI technologies to empower the development of human society. We believe that only through global cooperation and a collective effort can we realize the full potential of AI for the greater well-being of humanity.</blockquote><h3>Why are we worried, are AI systems really improving that quickly?</h3><p>In short, yes, AI capabilities are advancing really, <em>really</em> quickly, as illustrated below in the research by METR. In addition to outstripping humans in narrow, specialized tasks (e.g. when world chess champion Garry Kasparov was <a href="https://www.forbes.com/sites/martinrand/2024/03/08/to-understand-the-future-of-ai-look-at-what-happened-to-chess/">defeated by IBM’s Deep Blue</a>), current LLM-based agents are trending towards more generalist capabilities (ability to handle wide range of tasks) and higher agency (taking independent actions to achieve goals). Such advancements are expected to accelerate even further as we offload scientific and AI research to AI research assistants (e.g. <a href="https://sakana.ai/ai-scientist/">Sakana the AI scientist</a>). If AI systems can improve efficiency of AI research itself, we might be looking at super-exponential growths. The worry with these so-called <a href="https://www.alignmentforum.org/posts/pGXR2ynhe5bBCCNqn/takeoff-speeds-and-discontinuities">fast takeoffs</a> is that they leave very little time to implement control measures or regulations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*BW7Js1B1m3M2dStyD2ZZcA.png" /><figcaption>Task length achievable by generalist AI agents. The figure shows how the duration of tasks (measured by the time human professionals take) that frontier AI models can complete autonomously with 50% reliability has been doubling roughly every 7 months over the past 6 years. Shaded region = 95% confidence interval. <a href="https://metr.org/blog/2025-03-19-measuring-ai-ability-to-complete-long-tasks/?_bhlid=a3d8e301d66bd7aba2dd5de5253b42c092fb3f57">Source: METR Research, Measuring AI Ability to Complete Long Tasks</a></figcaption></figure><h3>How do we think about AI risks?</h3><p>As AI systems grow more powerful, the range of possible harm seems to be limited only by one’s imagination. How would we defend against an army of AI hackers probing our systems for cybersecurity weaknesses? Or a flood of deepfakes spreading fake news and undermining the democratic process? Before beginning to address such AI-related risks, it is often helpful to categorize them into broad classes. One way is to think of them as belonging to one of: misuse, misalignment, or systemic risks. The (ironically, AI-generated) infographic below gives a quick overview.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*VnCiZ4A6GUqUEysGE5jaaw.png" /><figcaption>AI risk taxonomy, summarizing different types of AI risks based on the framework from AI Safety Atlas (AI-generated infographic). <a href="https://ai-safety-atlas.com/chapters/02/01">Source: <em>Markov Grey and Charbel-Raphaël Segerie et al. 2025. AI Safety Atlas. French Center for AI Safety (CeSIA). URL: ai-safety-atlas.com</em></a></figcaption></figure><p>As shown in the infographic, AI risks are complex and do not necessarily fit neatly into a single category (see dark green box!). Additionally, many <a href="https://arxiv.org/abs/2408.12622">other frameworks</a> exist that may be more suitable depending on the context. That said, having a framework in mind helps us structure the discussion and often guides us toward more appropriate measures.</p><h3>How can we protect ourselves?</h3><p>Addressing AI-related risks requires a combination of diverse (and often interdependent) measures, encompassing both technical research and governance, depending on the specific risks targeted. The full spectrum of possible measures is too extensive to cover here, but to provide a brief overview, they might include:</p><ol><li><strong>Adapting cybersecurity practices</strong> — Including (among many others):<br>- Access control with API-based deployment as a protective layer from users intending misuse, in which guardrails can be implemented;<br>- <a href="https://arxiv.org/abs/2310.12505">Red‑teaming</a> to expose vulnerabilities and enable patching (e.g. prompt injection).</li></ol><p>2. <strong>Legal and regulations </strong>— laws and penalties as deterrent against misuse, e.g. illegal to use AI for misinformation, require watermarking for AI-generated content, etc;</p><p>3. <strong>LLM cleaning</strong> — data pre-filtering or unlearning to remove harmful capabilities from dual-use knowledge;</p><p>4. <strong>Interpretability research </strong>— to ‘see’ what an LLM is ‘thinking’, to uncover deceptive behaviours and sandbagging (i.e. LLMs pretending to be less capable than they are);</p><p>5. <strong>AI research assistant </strong>— to use AI systems to do research in alignment, cybersecurity, and other AI safety areas;</p><p>6. <strong>Defensive acceleration</strong> — Prioritizing technologies that strengthen defense and social resilience against AI risks. E.g. accelerate bio-defense research in the face of AI-accelerated bio-risks;</p><p>7. <strong>Governance (compute)</strong> — Limit AI development by controlling AI hardware supply chain. Unlike policy or regulatory approaches, it directly limits the capability to train or deploy risky AI models, providing a practical, enforceable lever to reduce potential harm;</p><p>8. <strong>Multi-level governance</strong> — corporate, national and international governance for frontier AI development. Relies on the availability of good evaluation frameworks;</p><p>… and many more. As AI risks are not confined by borders of any kind, international and public-private coordination is crucial to establish safe and effective frameworks, and guide AI safety research.</p><h3>What’s being done so far on the governance front?</h3><p>Currently, the European Union (EU) leads in legally binding regulations and oversight, while the US leads in frontier model development and technical safety R&amp;D, with UK and China also playing significant roles. Some notable governance frameworks are shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*c3BIZBN2DS5qzQW4nXbYfg.png" /><figcaption>Major AI governance instruments (AI-generated infographic)</figcaption></figure><h3>What role does Singapore play in regional and global AI safety?</h3><p>The recently published (July 2025) <a href="https://concordia-ai.com/wp-content/uploads/2025/07/State-of-AI-Safety-in-Singapore-2025.pdf">State of AI Safety in Singapore report</a> by <a href="https://concordia-ai.com/">Concordia AI</a> gives a comprehensive and up-to-date view of Singapore’s current AI safety ecosystem. As noted in the report,</p><blockquote>Singapore plays an outsized convening role in global and regional AI governance</blockquote><p>Indeed, the AI safety scene in Singapore has been growing rapidly in recent years.</p><h4>Governance Frameworks</h4><p>To guide responsible AI development, Singapore has developed a few voluntary governance frameworks, including:</p><ul><li><strong>Model AI Governance Framework</strong> <strong>(MGF) for Generative AI</strong> (<a href="https://aiverifyfoundation.sg/resources/mgf-gen-ai/">MGF-Gen AI</a>) — published by <a href="https://www.imda.gov.sg/">Infocomm Media Development Authority (IMDA)</a> and <a href="https://assurance.aiverifyfoundation.sg/report/introduction/#:~:text=The%20AI%20Verify%20Foundation%20%28AIVF%29%20is%20a%20non-profit,ecosystem%20through%20access%20to%20reliable%20AI%20testing%20capabilities.">AI Verify Foundation (AIVF)</a> in 2024 to address generative AI concerns for policymakers, industry, research, and broader public;</li><li><strong>A.I. Verify toolkit</strong> — supported by AIVF, an <a href="https://file.go.gov.sg/aivtf-pdf.pdf">open-source testing framework and toolkit</a> consistent with internationally recognized AI governance principles. (Fun fact: HTX participated in the <a href="https://assurance.aiverifyfoundation.sg/wp-content/uploads/2025/05/HTX-x-Knovel.pdf">Global AI Assurance Pilot programme</a> by AIVF, providing input for the development of the GenAI testing toolkit.)</li></ul><h4>Global AI Engagement</h4><p>Singapore plays an active role in shaping the regional and global AI safety ecosystem, including:</p><ul><li>Participating in international events such as the <a href="https://oecd.ai/en/list-of-participants-oecd-expert-group-on-ai">OECD’s Expert Group on AI in 2018</a>, and various AI safety summits (<a href="https://www.channelnewsasia.com/singapore/ai-safety-summit-singapore-pm-lee-frontier-3892476">Bletchley Park 2023</a>, <a href="https://www.mfa.gov.sg/Newsroom/Press-Statements-Transcripts-and-Photos/2024/05/Artificial-Intelligence-Seoul-Summit">Seoul 2024</a>, <a href="https://www.channelnewsasia.com/watch/singapore-rolls-out-new-initiatives-develop-ai-and-ai-safety-4931231">Paris 2025</a>);</li><li>Committing to international cooperation by announcing NTU’s Digital Trust Centre (DTC) as the <a href="https://www.imda.gov.sg/resources/press-releases-factsheets-and-speeches/factsheets/2024/digital-trust-centre">Singapore AI Safety Institute (AISI)</a>;</li><li>Hosting the <a href="https://www.scai.gov.sg/">Singapore Conference on AI (SCAI) for the Global Good</a> in 2023 and 2025;</li><li>Taking the leading role with Rwanda in advancing AI governance among small states through <a href="https://www.imda.gov.sg/resources/press-releases-factsheets-and-speeches/factsheets/2024/gen-ai-and-digital-foss-ai-governance-playbook">Digital Forum of Small States (FOSS)</a> by introducing the AI Playbook for Small States;</li><li>Leading the development of the <a href="https://www.globalcompliancenews.com/2025/02/15/https-insightplus-bakermckenzie-com-bm-technology-media-telecommunications_1-singapore-launch-of-expanded-asean-guide-on-ai-governance-and-ethics-generative-ai_01312025/">ASEAN Guide on AI Governance and Ethics</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*yMtCEKkYZr3BNAbYIPOdpg.png" /><figcaption>ASEAN Guide on AI Governance and Ethics. <a href="https://asean.org/book/asean-guide-on-ai-governance-and-ethics/">Source: ASEAN Publication</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*KbcHXWSxmFGLTJEjUQyUsw.png" /><figcaption>Expanded ASEAN Guide on AI Governance and Ethics — Generative AI. <a href="https://asean.org/book/expanded-asean-guide-on-ai-governance-and-ethics-generative-ai/">Source: ASEAN Publication</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*u2NRWfMJqIkhd8W1D_4ECA.png" /><figcaption>AI Playbook for Small States. <a href="https://www.imda.gov.sg/-/media/imda/files/news-and-events/media-room/media-releases/2024/09/ai-playbook-for-small-states/imda-ai-playbook-for-small-states.pdf">Source: FOSS</a></figcaption></figure><h4>Equitable AI Access</h4><p>To ensure equitable access to AI capabilities and focus on regional languages, two General Purpose AI (GPAI) models were developed locally by <a href="https://aisingapore.org/">AI Singapore</a>, the <a href="https://www.a-star.edu.sg/">Agency for Science, Technology and Research (A*STAR)</a>, and IMDA, namely:</p><ul><li>Southeast Asian Languages in One Network (<a href="https://aisingapore.org/aiproducts/southeast-asian-languages-in-one-network-data-seald/">SEA-LION</a>), optimized for Southeast Asian languages; and</li><li>Multimodel Empathetic Reasoning and Learning in One Network (<a href="https://www.imda.gov.sg/resources/press-releases-factsheets-and-speeches/press-releases/2025/sg-meralion-sea-empathetic-large-language-model">MERaLiON</a>), which is a multi-modal model incorporating audio capabilities. Fun fact, HTX is part of the MERaLiON Consortium! Check out our <a href="https://medium.com/htx-dsai/htx-x-meralion-towards-a-spoken-language-model-for-singapore-and-the-home-team-94c55252f8c6">medium article</a> introducing Spoken Language Models and MERaLiON!</li></ul><h3>What’s next for me?</h3><p>While leveraging AI for the good of humanity, we should be alert and proactive in defending against possible AI-related harms, whether unintended or deliberate from malicious actors. As a data scientist in HTX, I feel perfectly placed to contribute to AI safety in:</p><ul><li>Fighting systemic marginalization of underrepresented communities by focusing on Low-Resourced Languages (check out my intern’s work on <a href="https://medium.com/htx-dsai/ht-x-marks-the-spot-internship-journey-at-htx-d121966411ac">Tamil Text-to-Speech (TTS) capabilities</a>, and my colleagues’ work on <a href="https://medium.com/htx-dsai/how-we-talk-generating-singaporean-conversations-54aea9b6892b">Singaporean conversation dataset</a>, <a href="https://medium.com/htx-dsai/fine-tuning-multilingual-embedding-models-for-a-singaporean-context-1a9efd395e1f">multilingual embedding models for a Singaporean context</a>, <a href="https://medium.com/htx-dsai/finetuning-whisper-for-the-singaporean-home-team-context-a3ae1a6ae809">Speech transcription for Singlish</a>, <a href="https://medium.com/htx-dsai/hyper-localisation-of-text-to-speech-tts-systems-in-singapore-aafbd61e09a5">TTS with a Singaporean accent</a>!);</li><li>Defending against malicious actors in my core research on detecting deepfake audio attacks (medium article to come!). Check out my colleagues’ earlier work on deepfake <a href="https://medium.com/htx-s-s-coe/truth-or-trickery-diving-into-deepfakes-836800553802">image</a> and <a href="https://medium.com/htx-s-s-coe/uncovering-the-real-voice-how-to-detect-and-verify-audio-deepfakes-42e480d3f431">audio</a> detection;</li></ul><p>One key takeaway from the AI Safety Bootcamp, and from my time with the awesome Language AI R&amp;D (xData) team, is just how many passionate people are working to use AI for good, <em>safely</em>. Learning more about AI’s risks and potential also gave me a deeper appreciation for the important roles played by Singapore, the public sector, and HTX. It’s left me more motivated than ever in my own research!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Io0qdpyJZy_61TNDQtYGw.jpeg" /><figcaption>Miss you guys, ML4Good 2025!</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6780d335e26d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/i-joined-an-ai-safety-bootcamp-heres-what-i-learnt-6780d335e26d">I Joined an AI Safety Bootcamp — Here’s What I learnt</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hyper-localisation of Text-to-Speech (TTS) Systems in Singapore]]></title>
            <link>https://medium.com/htx-dsai/hyper-localisation-of-text-to-speech-tts-systems-in-singapore-aafbd61e09a5?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/aafbd61e09a5</guid>
            <category><![CDATA[peft]]></category>
            <category><![CDATA[data-augmentation]]></category>
            <category><![CDATA[speech-synthesis]]></category>
            <category><![CDATA[low-resource-language]]></category>
            <category><![CDATA[code-switching]]></category>
            <dc:creator><![CDATA[Clarence Teo]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 04:24:03 GMT</pubDate>
            <atom:updated>2025-11-24T04:24:03.427Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aMwshyUe0Y3816wCR0eRA.jpeg" /><figcaption>Hello from our latest workshop for Language AI R&amp;D! (Left to Right): Clarence, Clifton, and Calista</figcaption></figure><p>Hi! I’m Clarence, a linguist turned Data Scientist working in the Language AI Development team, as one of six Applied AI teams here at HTX. In my daily work, I develop <strong>Text-to-Speech (TTS) models</strong> that produce synthetic speech aimed at reproducing our unique, Singaporean way of speaking the English language! To add onto the amazing work that my DSAI colleagues have previously written about <a href="https://medium.com/htx-dsai/finetuning-whisper-for-the-singaporean-home-team-context-a3ae1a6ae809">recognising Singaporean English in ASR</a>, or <a href="https://medium.com/htx-dsai/how-we-talk-generating-singaporean-conversations-54aea9b6892b">collating a database of localised conversations</a>, I will talk briefly about what Text-to-Speech entails and how the latest advances in Speech Technology could possibly enable us to build more performant models for the Singapore diaspora.</p><h3>What is Text-to-Speech (TTS)?</h3><p>Text-to-Speech has rapidly evolved from the mechanical reproductions of the human tract to realistic and intelligible synthetic speech that forms the backbone of modern devices (e.g., voice assistants, audiobooks, educational content, and social media). As with most AI-powered domains, TTS systems can be observed in both closed- and open-source domains, where the Generative AI space is dominated by major tech companies now abbreviated by MANGO (Microsoft, Anthropic, Nvidia, Google, OpenAI).</p><p>In the current landscape of generative speech systems, open-source TTS systems offer a broad range of capabilities. These enable audio output on edge devices, such as Internet of Things (IoT) and mobile devices, as well as long-form conversational models capable of generating audiobook and podcast-style content. This is made possible through the latest developments in transformer⁵-augmented architectures with various attention-based adapters that provide semantic and prosodic⁶ improvements to the speech output observed.</p><p>However, the technical gap lies in the localisation difference between current TTS systems and what we require in order to cater for the localised Singaporean audience. This is not widely available now, with most models trained for American or British English speakers as opposed to a Singapore English speaker, evident by how un-Singaporean the inference clip sounds below, contrasted against the clip generated with our current in-house development efforts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2213942864%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fclarence-242380847%2Fnate-en-1%3Fin%3Dclarence-242380847%2Fsets%2Farticle-medium-01%26si%3De944ab792a2340ef99d265de79966572%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/5257d31fa5c2a8f05c5d436d9166e152/href">https://medium.com/media/5257d31fa5c2a8f05c5d436d9166e152/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2213942861%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fclarence-242380847%2Faudio-sgen-2%3Fin%3Dclarence-242380847%2Fsets%2Farticle-medium-01%26si%3D46152cdd7b0d4eb08fc5bdb7b80526f8%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/1bcc7dc5a923b7e0de8e2cf18926d560/href">https://medium.com/media/1bcc7dc5a923b7e0de8e2cf18926d560/href</a></iframe><p>As such, it becomes a critical endeavour to train models that can speak like Singaporeans, and in a way that can be understood as realistic beyond the uncanny valley. In the following segment, let’s unpack the motivation behind synthesising Singapore English speech in a deeper fashion.</p><h3>Why Synthesise in Singapore English?</h3><p>Developing TTS systems for Singapore is more than a technical exercise, it addresses a fundamental gap in hyper-localisation of generative AI resources. <strong>There’s a clear need for naturalistic, culturally appropriate spoken interfaces that resonate with local speakers</strong>. As digital assistants, automated announcements, and voice-enabled services become increasingly prevalent, the accent and prosody of synthetic speech significantly impacts user experience, trust, and comprehension (also <em>intelligibility</em>).</p><p>Currently, most speech applications in Singapore rely on TTS engines trained predominantly on American or British English voices. While the case has been established for generative systems to understand localised textual input such as <a href="https://medium.com/htx-dsai/htx-x-meralion-towards-a-spoken-language-model-for-singapore-and-the-home-team-94c55252f8c6">A*STAR-I2R’s recent MeRALiON</a>, these speech systems produce intelligible output in their own locales but lack the phonetic characteristics, prosodic patterns, and lexical features that define Singapore English. This disconnect between textual and spoken interfaces creates a sense of artificiality that undermines system effectiveness, particularly where natural communication is essential.</p><p>Looking ahead, Singapore English TTS will play a crucial role in public-facing systems. Emergency warnings, public transport announcements, healthcare applications, and community service platforms would all benefit from speech that sounds familiar and trustworthy to Singaporean listeners. When a synthesised voice speaks with local accent features and appropriate prosody, it enhances accessibility and ensures critical information reaches all segments of the population clearly.</p><p>Beyond direct user applications, <strong>Singapore English TTS holds significant potential for synthetic data augmentation in Automatic Speech Recognition (ASR) systems</strong>. Training robust ASR models for Singapore English is challenging due to limited annotated speech data. By generating synthetic Singapore English speech with controlled variation in speakers, prosody, and acoustic conditions, we can substantially expand training datasets and improve ASR performance for local accents and code-switching patterns. This creates a virtuous cycle where advances in TTS directly enhance speech recognition capabilities for Singaporean contexts.</p><p>Given the potential to positively impact public services and accessibility, the challenge lies in data availability for high-quality training of localised TTS systems, which can then propagate improvements to downstream speech tasks such as ASR. It’s therefore valuable to examine how TTS systems can be leveraged for ASR enhancement, particularly considering the latest advances presented at conferences such as Interspeech, SynSIG, and APSIPA 2025.</p><h3>Can Synthetic Data Solve Data Constraints?</h3><p>Synthetic data has emerged as a powerful tool for augmenting training datasets in low-resource ASR, particularly when dealing with limited data or small speaker populations. Singapore English faces similar challenges: while the speaker population is stable, limited speech data exists for training.</p><p>The concept is straightforward. High-quality TTS models can generate large volumes of synthetic speech paired with ground-truth transcripts to supplement limited real-world data. A recent paper [1] demonstrated that synthetic data augmentation improves ASR performance, particularly for code-switched speech in Singapore, where speakers fluidly switch between languages (e.g. Mandarin, Hokkien, English). This naturally complicates automatic transcription.</p><p>The work showed that an end-to-end synthetic data pipeline (Figure 1) successfully generated synthetic speech for improved ASR performance. Using high-quality TTS systems, combining real speech with randomly-sampled synthetic data at a 1:1 ratio lowered the Mixed Error Rate (MER) to 16.1% on SgE code-switched ASR, compared to 17.8% using only real data and 22.4% using only synthetic data.</p><p>The authors identified speaker diversity as a key factor in reducing error rates. They noted that synthetic data complements rather than replaces real-world data, augmenting otherwise unavailable information. This conclusion is echoed in a paper on synthetic data for dysarthric speech recognition [2] at Interspeech 2025, where synthetic dysarthric speech cannot fully capture the complexity and diversity of real-world dysarthric speech, with only marginal improvements observed in Dysarthric Speech Recognition (DSR) performance. Notably, the synthetic data showed limited acoustic features compared to live data, contributing to its weakness as a substitute for live data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-U_usl55uYojZCcbGZwohA.png" /><figcaption><em>Figure 1. Synthetic-data pipeline used to fine-tune Whisper for ASR [1].</em></figcaption></figure><p>Beyond public-facing communicative interfaces, localised TTS systems also hold significant potential for synthetic data augmentation in Automatic Speech Recognition (ASR) systems. Training robust ASR models for Singapore English is challenging due to limited annotated speech data. By generating synthetic Singapore English speech with controlled variation in speakers, prosody, and acoustic conditions, we can substantially expand training datasets and improve ASR performance for local accents and code-switching patterns. This creates a data-training loop where advances in TTS directly enhance speech recognition capabilities for Singaporean contexts.</p><p>The current TTS data landscape for Singapore English is severely limited compared to other open-source datasets. For example, the National Speech Corpus created by IMDA and NTU has only 22 hours dedicated to TTS system training. However, this selection of spoken sentences was crafted for read, formal speech with hyper-articulated phonological features that sound closer to American English than to native Singapore English. The TTS partition is also limited in size (Table 1 below) compared to other open-source TTS datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUP60vxxC0vvKcFMh4tjQA.png" /><figcaption><em>Table 1. Comparison of SgE TTS Dataset against other open-source TTS datasets.</em></figcaption></figure><p>Data is a major barrier to synthesising realistic speech in Singapore English. This challenge intensifies with hyperlocalisation efforts in other national languages, but that’s a problem for another day. While we aim to bridge the gap between what’s available and the performance observed with Inner Circle Englishes, the question remains: why focus on synthesising Singapore English?</p><p>To further the discussion on synthetic data in augmented training pipelines, there has been work establishing scaling laws for synthetic data in ASR training [3], as shown in Equation (1) below. So how much data do we have to synthesise for effective training? According to research on scaling laws, at low-data conditions (around 100 hours of real-world data), you would need at least <strong>25–50x</strong> the amount of synthetic data to train the ASR model up to comparable performance against the same model trained with just real-world data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*nrUcATtwslci_em4sx0evg.png" /><figcaption>Equation 1. Scaling law for predicting ASR model performance, given dataset size <em>D</em> with learned variables of the power law in the first term, and accounting for TTS-for-ASR deviations from the first term via the second term.</figcaption></figure><p>This supports the findings observed in the works discussed above and reinforces a key principle: synthetic data should strategically supplement and augment existing real-world data rather than replace it entirely. Then, by using synthetic data strategically to address coverage gaps in the datasets, rather than entirely replacing real-world audio data. For Singapore English or any other low-resource target language, investing in high-quality localised TTS infrastructure (through data pipelines, collection efforts, or efficient training regimes and architectures) not only enables better voice interfaces but also provides the foundation for more accurate speech recognition across our diverse linguistic landscape.</p><h3>Training in low resource-like conditions: Singapore English</h3><p>To continue on training in low-resource conditions, there are other strategies to optimise low-resource conditions for TTS systems. To highlight one of the interesting works observed, Kwon et al. [4] presents a parameter-efficient approach to training TTS systems under low-resource conditions, which is particularly relevant for Singapore English given its limited data availability. The method leverages cross-lingual continual learning with F5-TTS, a Non-Autoregressive (NAR) architecture that uses flow matching and Diffusion Transformers (DiT).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VbfynRg2GzlJb3lNlt2GZg.png" /><figcaption>Figure 2. Overall frameworks of PEFT-TTS. (a) Based on the pre-trained F5-TTS, we added three adapters for cross-lingual continual learning. (b) Conditioning Adapter for ConvNeXt. (c) Prompt Adapter with DropPath for prompt tuning. (d) LoRA adapter for DiT [4].</figcaption></figure><p>In this approach, the authors employ three key components for efficient adaptation: (1) c<strong>onditioning vectors</strong> that guide the generation process, (2) p<strong>rompt-based adaptation</strong> for speaker characteristics, and (3) <strong>DiT LoRA adapters</strong> that enable fine-tuning with only 1.72% of total parameters. Remarkably, this method achieves strong performance using just 12 hours of single-speaker data whilst maintaining multi-speaker scalability. By using the 3 adaptor modules, the author found greater performance when attaching them to the F5-TTS model as opposed to regular fine-tuning of the F5-TTS model using the same dataset, with an UTMOS⁷ score of 3.338 compared to 3.152, all while training a small fraction of the model instead of fine-tuning of the full model’s parameters. This paper, amongst many others, showcases how we may move forward with TTS training regimes under low-data conditions and definitely acts as one of the possible methods we may employ in our research to bring localised TTS systems to fruition across our use cases.</p><h3>Conclusion</h3><p>Our current work on Singapore English Text-to-Speech (TTS) systems is still a work-in-progress, but we have observed pretty decent samples so far with specialised in-house fine-tuning efforts. Our approach, by focusing on the phonological representation of Singapore English, allows for more naturalistic synthesis of text sequences. However, it would be far from ready when considering Colloquial Singapore English (CSE, also <em>Singlish</em>) with its rich lexical references, particles and prosodic shifts for communicative intent. Our work in the future would definitely continue to observe the latest trends in TTS across its various subfields and evolve towards a natural, conversational system for Singaporeans.</p><p>I would like to thank my Language AI R&amp;D team (Rachel Tan, Aloysius Tan, Calista Choy, Jason Ng, Fwu Chyi Teo, Clifton Teo, Shing Yee, Lye En Lih, Rosamund Lim, Chin Zhuo Sheng, Lim Ming En, Joe, Bryan Lim, Jun Ru, Natasha, Neleh), AI Products, and the broader AI R&amp;D umbrella for the support of Text-to-Speech endeavours, my supportive director Lim Kian Boon and ACE Ang Chee Wee for believing in my vision towards hyper-localised TTS systems for the Home Team.</p><p>Please stay tuned for further TTS updates and developments on our publication, DSAI! For any enquiries and communique, please direct them to Clarence Teo (<a href="/service/mailto:Clarence_Teo@htx.gov.sg">Clarence_Teo@htx.gov.sg</a>).</p><h3>References</h3><p>[1] Yeo, Y.H., Hu, Y., Gopal, S., Peng, Y., Liu, H., Chng, E.S. (2025) Improving Code-Switching Speech Recognition with TTS Data Augmentation. Proc. 2025 Asia Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC). IEEE.</p><p>[2] Li, J., Feng, K., Zhao, X., Wang, Y., Wang, S.-J. (2025) Synthetic Dysarthric Speech: A Supplement, Not a Substitute for Authentic Data in Dysarthric Speech Recognition. Proc. Interspeech 2025, 2755–2759, doi: 10.21437/Interspeech.2025–1174</p><p>[3] Minixhofer, C., Klejch, O., Bell, P. (2025) Scaling Laws for Synthetic Speech for Model Training. Proc. Interspeech 2025, 3189–3193, doi: 10.21437/Interspeech.2025–2750</p><p>[4] Kwon, K. J., So, J. H., &amp; Lee, S. H. (2025). Parameter-Efficient Fine-Tuning for Low-Resource Text-to-Speech via Cross-Lingual Continual Learning. In Proc. Interspeech (Vol. 2025, pp. 1613–1617), doi: 10.21437/Interspeech.2025–1344</p><h3>Footnotes</h3><p>[5] Transformers: the approach that enables modern large language models powering ChatGPT and Gemini!</p><p>[6] Prosodic: patterns of rhythm and sound in language, such as stress, intonation, and pitch.</p><p>[7] UTMOS: UTokyo-MOS (Mean Opinion Score), an objective metric that approximates MOS. A higher score indicates a more performant model, with a range of 1 to 5.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aafbd61e09a5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/hyper-localisation-of-text-to-speech-tts-systems-in-singapore-aafbd61e09a5">Hyper-localisation of Text-to-Speech (TTS) Systems in Singapore</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Historian Who Is Learning to Build the Future]]></title>
            <link>https://medium.com/htx-dsai/the-historian-who-is-learning-to-build-the-future-7e3cc6393464?source=rss----4624f6c96b9f---4</link>
            <guid isPermaLink="false">https://medium.com/p/7e3cc6393464</guid>
            <category><![CDATA[motivational]]></category>
            <category><![CDATA[ai-product-management]]></category>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[transferable-skills]]></category>
            <dc:creator><![CDATA[Germaine Kong]]></dc:creator>
            <pubDate>Tue, 30 Sep 2025 08:01:33 GMT</pubDate>
            <atom:updated>2025-09-30T08:00:59.670Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Lessons from leading an AI product at the intersection of history, strategy, and technology.</em></p><p>Bullet holes on the façade of the Philippine General Hospital, a steel flagpole pockmarked by shrapnel at the entrance of the old U.S. Embassy building, walking on the very grounds of the Santo Tomas university that was once used by the Japanese to incarcerate civilians. I remember exploring the streets of Metro Manila, finding traces of the scene of the worst urban fighting by the American forces in the Pacific region.</p><p>To me, history was never just dates and battles. It was narrative: how the same artefact or event could mean different things to different people. That fascination led me to take up history for my undergraduate studies, specialising in military history. My world revolved around understanding the strategies, weapons, and decisions that shaped conflicts across time.</p><p>When I graduated, it seemed natural to join the defence and security space. I wanted to contribute, even in a small way, to the safety of my nation. What I didn’t expect was to begin in a technology agency, HTX, working in strategic planning. Yet that role opened my eyes to something bigger. It wasn’t just about analysing the past anymore. It was about helping to shape what came next.</p><p>Today, when people ask what I do, I reply: <em>“I’m a product manager in tech, focused on AI.”</em> The inevitable question that follows is: <em>“Wait — how did you get there?”</em></p><p>This is the story of my unexpected yet fulfilling journey from studying history’s battlefields to shaping the future with technology.</p><p><strong>The Historian’s Toolkit</strong></p><p>At its core, military history is the study of change amid chaos. It demands curiosity, critical thinking, strategic insight, and above all, storytelling. As a student, I spent years scrutinising sources, questioning assumptions, and weaving together threads of evidence into coherent narratives.</p><p>What I didn’t realise then was how transferable these skills were. Spotting gaps, asking incisive questions, synthesising ideas, and communicating them clearly — these turned out to be the very muscles I now flex daily as a product manager.</p><p><strong>From Strategy to Technology</strong></p><p>In HTX’s strategic planning team, I applied historian skills to a new battlefield: corporate decision-making. Strategic planning felt akin to planning a military campaign. Anticipating moves, weighing risks, and aligning people around a purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGaLkPox1z0eC9QwzAqzuw.jpeg" /><figcaption>HTX’s annual workplan discussion with the leadership group</figcaption></figure><p>But while strategy allowed me to see the big picture, I noticed a blind spot: I didn’t fully understand the technologies I was helping to plan for. Unlike my peers who came from technical backgrounds, I lacked the language and context of how these capabilities were actually built. That itch to close the gap eventually led me to make a bold switch.</p><p><strong>Taking the Leap</strong></p><p>When the opportunity arose to join xData, I hesitated. Could a history graduate really thrive in a tech team? But my bosses encouraged me to take the leap.</p><p>The transition was daunting. I had to lead a product team while simultaneously learning the basics of software development, AI fundamentals, and product management methodologies. On top of delivery deadlines, I squeezed in courses on product management, design thinking, and AI.</p><p>It was a steep climb, but my historian’s mindset helped: evaluate evidence, understand context, strategise, and communicate. Each challenge became a chance to grow.</p><p><strong>How History Made Me a Better PM</strong></p><p>Before taking the leap, I was worried that my lack of technical knowledge would make me an ineffective product manager. I soon realised that in reality, it’s about people, problems, and creating value. My background gave me unique tools:</p><ul><li><strong>Research &amp; Analysis:</strong> Digging into user pain points felt just like interrogating historical sources.</li><li><strong>Strategic Thinking:</strong> Anticipating risks and aligning teams was straight out of my strategy playbook.</li><li><strong>Storytelling:</strong> Whether presenting a user journey or pitching a roadmap, narrative brought alignment.</li><li><strong>Empathy:</strong> Understanding historical motives trained me to listen deeply to users’ needs.</li><li><strong>Critical Thinking:</strong> Questioning assumptions helped us build responsible, bias-aware AI solutions.</li><li><strong>Communication:</strong> From academic presentations to sprint reviews, clarity remained my biggest asset.</li></ul><p><strong>The Challenge (and Joy) of AI</strong></p><p>Working in AI has been exhilarating and sobering. The potential is vast: automation, personalisation, discovery at scale. But like history, context is everything. Data carries bias; unchecked innovation can ripple harm.</p><p>Leading the Singapore Police Force’s first public-facing AI product reminded me of this responsibility. Collaborating with policy, governance, and safety teams reinforced the need to build not just powerful tools, but trustworthy ones.</p><p><strong>Lessons Along the Way</strong></p><p>The journey wasn’t smooth. I wrestled with imposter syndrome, moments of self-doubt, and the challenge of catching up technically. But there were also milestones I’ll never forget: launching SPF’s first AI product, securing buy-in across stakeholders, and watching our work make real-world impact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wOG9GCAPgJaS0heF3GnfNg.png" /><figcaption>My amazing team behind our product</figcaption></figure><p><strong>Full Circle</strong></p><p>On hindsight, my story is less about leaving history behind and more about carrying it forward. The same skills that helped me make sense of past conflicts now help me build the future.</p><p>What I once thought was a “non-technical background” turned out to be a strength. Technology thrives on diverse perspectives, and the bridges between disciplines are built by curiosity, courage, and a willingness to learn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e3cc6393464" width="1" height="1" alt=""><hr><p><a href="https://medium.com/htx-dsai/the-historian-who-is-learning-to-build-the-future-7e3cc6393464">The Historian Who Is Learning to Build the Future</a> was originally published in <a href="https://medium.com/htx-dsai">HTX DSAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>