Code Story · Transcripts

S11 Bonus: The 77% Token Tax: Why Fixed-Token Chunking is Poisoning Your Enterprise RAG Pipelines and How to Fix the Ingestion Layer with Dr. Alex Kihm, Founder & CEO of POMA AI

August 28, 2025 · 24:42
Listen to the episode Download .txtDownload .vtt
Dr. Alex Kihm

We built this testing pipeline and there was external services involved and I think it was even a typo or something on the level of a typo in the code. And we still ran the pipeline with the whole data set. We had this 200,000 legal tax parsed back then. So instead of sampling, we just put everything to it. We had spent a lot of money for running this pipeline with everything. I don't even remember why we were so stupid. Bit, but it was a good test of, okay, also do I go nuts? Do I go nuts? Because for me it was the, okay, Should I blame people now? Should I have known better? My name is Alex Kihm. I'm the founder and

Sound bite

CEO of POMA AI. This is Code Story, a podcast bringing you interviews with tech visionaries It's been six months moonlighting. There's nothing on the back end.

Noah Labhart

Who share what it takes to change an industry.

Sound bite

I don't exactly know what to do next. It took many goes to get right.

Noah Labhart

Who built the teams that have their back.

Sound bite

A company is its people. The teams help each other achieve more. Most proud of our team.

Noah Labhart

Keeping scalability top of mind.

Sound bite

All that infrastructure was at the gate. Yes, we've been fighting it as we've grown. Total waste of time.

Noah Labhart

The stories you don't read in the headlines.

Sound bite

It's not an easy thing to achieve, mind you. Took it off the shelf and dusted it off and tried it again.

Noah Labhart

To ride the ups and downs of the startup life.

Sound bite

You need to really want it. It's not just about technology.

Noah Labhart

All this and more on Code Story. I'm your host, Noah Labhart. And today, how Alex Kihm is solving the chunking problem you didn't know you had to solve AI hallucinations and overconsumption of resources. sources. Alex Kihm just turned 40 and has been into computers for 36 years. He was given his first hand-me-down computer at the age of 4 by his parents and also grew up with Lego bricks and building things. He's an engineer by training but eventually switched to econometrics on the big data side. But outside of his professional life, he's married and describes himself as water affectionate. He enjoys swimming, diving, and freediving. semester abroad. His freediving is mainly a hobby but he has deep respect for the professional freedivers of the world. At his original startup Alex started to dive into LLMs and immediately ran into RAG which stands for Retrieval Augmented Generation. When he observed the wrong information being returned along with a ton of resource consumption in the process i.e. cost, he set out to solve that problem and figured out the solution was in the chunks. This is the creation story of POMA AI.

Dr. Alex Kihm

When I wrote my PhD, which is more than 10 years ago, to be fair, I actually finished it 12 years ago, I dabbled a bit with neural networks. Obviously, you might remember these times that we had a lot of pattern matching, OCR worked well, and you could do stuff with neural networks and machine learning. But what wouldn't really work is like large scale, I would say actual intelligence, more like pattern matching and not actual intelligence. Funny enough, we dropped this avenue and I did the forecasting model very traditionally, 85 predictors, classic hypotheses, but very huge, 6 billion observations. And it outperformed the machine learning approaches there. So that was for me like the start of a big break with this discipline. And later, when LLMs became a thing where you realize there is some sort of intelligence coming up, curious, okay, what we could we do with it. And back then, which is, let's say, three years ago, two and a half, something like this, like just before ChatGPT. Like you remember the times, like GPT-2 impressive, GPT-3 coming up, and then some people were like, there might be something to it. And I dabbled with it because I have another startup. I found it already 22 years ago, I think. It was the first German legal tech. It's still running. It's still a very nice platform. We have 10,000 law firms When ChatGPT came up, can we do something for them? Like in a domain specific chatbot, we said. So we said, okay, obviously professionals try to use ChatGPT on autopilot mode and it just comes up with citing cases that were never there and so on. So we said for the lawyers, we need something that is a bit more accurate and more domain specific and fed with real information. We quickly ran into RAG, retrieval augmented generation, where you realize that you cannot make the model and more. You cannot fine-tune it to knowledge. That's what some people misunderstood. We always say training is for intelligence, fine-tuning is for style, and then the knowledge has to come from RAG. And we actually made it quite far. And then we had the demo night, like the private demo, just with some friends and interested parties. And then in the end, one question would cost $1 because you had to put so much into the context to really have the whole truth. And then also with the full context, it became convoluted and garbled. And we realized it's actually about the like in a very coarse way. And it's impressive how few people actually thought so much about chunking. Everyone just says, okay, there's the text and I just chunk it. I chop it up basically. At some point you go through the text from the beginning to the end. And at some point you need to set cutoffs, which means the text in itself, it loses its spatiality. The only way to find it again, and this is what classic chunking does, is having huge overlaps, including all the neighbors and so on. So we said, let's not dive into this domain-specific GPT building anymore because we really found something where we can put some serious effort into a more deep tech kind of approach. Like less agency and less selling systems to customers, but really let's go tech. We always dreamt of it. Then there was really this moment. I don't remember it exactly, but it was literally something like I was stumbling in the bathtub and whacking my head on the wall. And I told my wife, who's also a coder, hey, I got it. I got it. I know what we need to try. And what we tried, which is let's put the text into an LLM and let the LLM tell us the text again, like literally verbatim and make speech breaks so we can detect the text structure. There are more elaborate approaches to chunking, obviously. So there are people who say, for example, for each page, give me a summary. And then they embed the summary as well. say you have this moving window embedding and so on. But all the LLM-based stuff, there's people who do chunkings based on LLMs, but what they do is they always ask the LLM for, let's say, meta information, summarize what this chapter is about. This always creates a potential bias. So you imagine we want to have a system that avoids hallucinations, and we introduce potential hallucinations in the process. So we said, keep the text verbatim but indent it like code. And POMA text verbatim, but it would be structured like code. And it sounds so stupid, but it works because LLMs think while they are speaking. We leverage this fact that the next token is predicted by not only the token before, but all the tokens before and so on. And this means when the LLM is repeating the text for us and it's down there deep in the tree of this text, it still knows what the other headings were and what comes next and so on. It's just working so brilliantly. Once we have this kind of tree, we bring back the implicit spatiality from the text. And that means we can structure the information in a totally different way. And this is why what our customers embed are not chunks anymore, but are what we call chunk sets. So let's say every sentence is a chunk. And then what we give you is through this tree, we traverse it in every potential root to leaf path. And this is like a chunk set. can be quite deep, can have more than 10 levels, but that still would mean like a chunk set is like 10 sentences just crawling up or like we crawl up actually to calculate it. But obviously when you read it, it crawls out. You start at the title of the document, then comes the heading, subheading, subheading, and then the sentence. This is an information that is so perfectly clear. You know what it's talking about in which subdomain and what the actual topic is, and then comes the sentence. So it's worth quite a lot more in terms of information content than having half a sentence that you don't know what it's talking about. And that makes for very great embeddings. And then you get like the exact perfect retrieval. When people embed these, they are normally we go around 500 tokens, but we never broaden it. You retrieve several of them. And then we have the second part of our magic. Since it's all traversal paths with the document and they're perfectly codified, we can then fuse them. So in the end, what you get when you have the RAG powered by POMA, what you get back is, at retrieval, is one we call it a cheat sheet. Just imagine you have someone that says, here's a book and I have this question, and what you get back as a cheat sheet is basically having each line that is relevant perfectly text marked, and then, you know, cut together, and you only get the text marked lines. That's basically the product, the

Noah Labhart

First one I want to dive into the the MVP for how you approach it, right? And you touched on it a little bit kind of in the early part of the conversation, but there's a progression, obviously, in how you've built the product to date. But I'm curious about the first version, how long it took you to build to get to that aha point. And then, you know, what sort of tools you're using to bring it to life?

Dr. Alex Kihm

We obviously had so many paths at that end, and that's part of the game. So we used, I think, every document processing tool there is. Sometimes I found even some obscure new PDF converter. And then there's several startups. And then there's like services like unstructured, where you can always try to first ingest your data. And we tried this a lot. Then I tried every chunking method. And so we had like our own little micro ecosystem. We early on programmed, let's say, the hub ourselves. So we have obviously Python based. We had several microservices. In the beginning, it was escalated. escalated so before hadn't but worked with monolith and you say let's go microservice and then you bitch like 20 services for a simple problem so then you reconsolidate that is this is what we did and but for chunking to be honest like the once we had our approach let's do chunk sets instead of chunks and let's go with the indentation and so on not much changed ever since because it's really it's an llm call and then obviously retrieve that then you walk through this tree. This is not many lines of Python. You could optimize it a bit. That's true. And you build a lot around it. But that's quite straightforward. What we did is a lot of fine tuning stuff. We had our own internal tools where, for example, this is like a constant pattern in the company that I have like this idea, like Alex hit the wall again and had another shower. And then I say, I try to describe with my hands, I need this tool where I can do this and that. And then for good reasons, my beloved colleagues look at me with serious, yeah, what? And then I hack together a little prototype that just half visually, half in code describes what I mean. And then we build it together. For example, I have this tool where we have a text, we let it indent, and then I can manually correct it. And then send it straight to fine tuning, stuff like this. Because using tools for this kind of stuff doesn't really make sense because the approach doesn't exist per se. say, as the old, the classic labeling, data labeling software, or stuff that Scale AI does, which I deeply respect, we couldn't use because we have this novel approach of let's indent text. And so we have a lot of custom codes for our stuff, and this obviously evolves in quite a maddening way now. I like it, but The good thing is, I have colleagues that work with me for a long time and they know, like, my approach but also theirs. We agreed on, we never have this author's ego in our code. The quality should be high, but that still means we might put it in the freezer and then it might be de-iced at one point. We pivoted many times from one model to another, from one LLM to another. Let's try with Anthropic. Oh, it works so well. It doesn't work with the new text. Oh damn, let's scrap it, because it has to be robust and so on. So we went through so many different approaches, not like super pivot. We still chunk texts because this is what we do and we know that this is very necessary and impactful But how we do it in detail and with which models that can change any minute. And people are ready for that because this is how we get better.

Noah Labhart

You went through all the pivots, right? And you went through the fine tuning, the tweaking and things of that nature. I'm curious about, you know, to kind of wrap that in a box a little bit, how you, you know, quote unquote, built your roadmap. How did you decide what the next most important thing was to build or to tweak or optimize or address with POMA?

Dr. Alex Kihm

When we decided that we really want to crack this chunking with our novel approach, what we actually did is first built like really non-shippable code that proves to ourselves that it works. We wanted and did a hand in a patent. So we submitted a patent. We got a German one already and then we got like a utility patent. And then we submitted also to the USPTO where we are now in the second round. And we needed to make sure that the approach works really well because only then it makes sense to patent it. it was more like a research lab kind of approach and then we decided to do a company with it. The big question was like okay what are we selling? There's some so often it happens I'm very lucky that for me it's the third company now and I learned a lot in the former companies and the main thing was if you offer too broad a product or too much at once even though you think from your ego yeah I can do this and that yes maybe but then you do nothing really well and also no one knows what you're selling and this was for us maybe the most important thing we just now just before launching i mean we're still pre pre-revenue we have a lot of design partners and the system works but we are still taking it very carefully and white gloves and we just even reduce the product even further for example before we would say you give us a pdf and then we do the chunks for you but luckily because of many of the talks and calls with the design partners and startups that are now onboarding, they said, guys, but I already have a text. And then we said, why rock the boat? Why enter a part of the market that is not really important for us? If we are the chunking guys, let's really focus on chunking. So it was more like reducing the product further and further and further. That's maybe the most important design vector I've realized this time more than ever before.

Noah Labhart

Let's switch to team. I'm curious about how you built your team. Probably in the early days, you had some team members that you started out with, but you had to add folks, I'm sure. Tell me about what you look for in those people and indicate that they're the winning horses to join you.

Dr. Alex Kihm

There's certainly several people who would say I'm the king of nepotism. It always seems like I employ my friends, but I would counter that I also have friends who don't work for me, don't worry. I like to surround myself by people that inspire me and that I can also respect in every sense. fans or people that are just looking up to me or working to me, but I want people working with me, and I have these, a lot of these people are with me for 10 years and more. So the decision was really easy. It was more like, okay, my old friend there, he's still in my former company, do I make him the offer of switching to the new one? I mean, our stockholder is actually my wife. She only works for me now, like for this project, so like for two years now, but obviously before we've been mentors to and we knew very well what our skills are. And I have this with, I think, six out of eight people in the team. I like it when I know what to expect. There's obviously always new people and we just employed two new ones that I also, you know, I have high expectations in terms of, I think it will be really good. Also because we're not so junior. I'm 40 years old and I think the average age in the company is just a bit less. So for a startup, we are quite mature in terms of people. At this point you have a certain network, like for example the old, my old co-founder from my former company where he was the CEO and I was the CTO. I just onboarded him as my head of strategy, finance, and legal. So now we flip the deck and now he works for me. Now we have the super tech focused company, the one before was a fintech. I have the super tech focused company and I need someone that I can trust that covers the business side. Boom, he just signed and I love this. It's always is very quick. I love this. Calling someone, hey, I have a new gig for you. Yeah, I love it. Let's do it. Literally, most of the calls were like this.

Noah Labhart

So as you step out on the balcony, look look across all that you've built thus far with POMA. What are you most proud of? There's a lot to be proud of here, a lot of things that you're cracking, but I'm curious what you're going to say.

Dr. Alex Kihm

It's the first time that I do something so deep tech that it qualifies for a patent, and that actually most people wouldn't say I like it that they don't understand it at first. That sounds a bit arrogant, but I like it that apparently the depth of the value is so deep that there must be something to it. It's not like selling some stuff online. Don't get me wrong. We all need our e-commerce, but I understand this in a minute. And if something so profoundly impactful, I mean, it saves between 50 and 80 percent of energy for the same question at more accuracy. And I like it that we don't do it by just cutting something short, but by something that is so elaborate that it qualifies for a patent. I am honestly proud of that.

Noah Labhart

Let's flip the script a little bit. Tell me about a mistake you made and how you and your team responded to it.

Dr. Alex Kihm

We built this testing pipeline and there was external services involved. And what we did is we had, I think it was even a typo or something on the level of a typo in the code. And we still ran the pipeline with the whole data set of, we had this 200,000 legal text parsed back then. We ran the whole pipeline with this typo. So instead of sampling, we just put everything to it. We had spent a lot of money for running this pipeline with everything. I don't even remember why we were so stupid. But it was a good test of, okay, also do I go nuts? Do I go nuts? Because for me it was, okay, should I blame people now? better, and everyone was like trembling, now we really screwed it, and will Alex kill himself or us or what would happen. And he said, you know what, guys, this time the order of magnitude is a bit high, but you know what, I've learned one thing: if someone blows anything up, never ever fire the guy. Keep him, because he will never do it again. And the same holds for me, and the same holds when I can deal with this mistake now, they will trust me that I'm not short-fused and said, okay, you know know what, wipe the slate, get some new money, and let's do this again with a 1% sample, please. And then we do this at 100%. So we all learned.

Noah Labhart

Let's move forward then. This is really exciting. I'm super jazzed as an engineer and as someone who understands rag and chunking about what you've built and what you've accomplished. What does the future look like for POMA, for what you're building and for your team?

Dr. Alex Kihm

So what we're building is currently our demonstrator, because obviously the algorithm itself works and we're starting to onboard companies who want us to include in their pipeline because it's quite easy. But what I, what we need for new people to get interested is some sort of visualization, and it's really the biggest challenge I've ever had. We are by design an invisible product. If I explain chunking to my mom, you can always do these hacking motions like in the kitchen or something. But otherwise, it's quite hard to visualize chunking and especially to visualize our stuff. We at least have the tree. That's a nice thing. But visualizing what we're doing to also explain vis-a-vis what others are doing or what the conventional approaches are, more to say. It's not really people or companies who chunk. So this is something I'm personally leading this project and it takes up most of my time for now. And also with the team now, Now, we will build this demonstrator that really makes it sexy to think about chunking and look at chunks and say, ah, this is beautiful. And that is a high bar to get there. So we are totally focused on that. For a backend company, we now have an interim frontend focus even, which is challenging because iOS developers always have this, they still have a foot in frontend. You can imagine our Python backend guys, they don't. Now we need to overcome this. And there again, I have this old colleague 10 years ago. I call him and I need you for front-end. Yeah, okay. He just signed on last night. So we do this front-end stuff to visualize what we are doing. That's like the very big thing that's coming now. And then we can reach out and also with the team, imagine like account executives, they find customers, they show them the demo. And if that works, we get into this flywheel of going out with the demo, showing people with their text, by the way. So they can paste like their sample document and see what it would change for them. tangible, like not abstractly, oh, get my software and your ROI gets up by X. That doesn't make much sense in most of the cases. But if you say, give me your text, I show you, this is what comes out now. This is what comes out with us. Everyone gets it. And this is tough to visualize. But I like the challenge. And I think we are almost there.

Noah Labhart

Alex, let's switch to you. Who influences the way that you work? Name a person or many persons or something you look up to and why.

Dr. Alex Kihm

There is my dad, to be honest. In many ways, people would say there was maybe a bit old school or not super, or let's say not very modern approach. And you could frame it negatively, but I frame it positively. He always said, you just need to do everything yourself. But what he meant is you need to understand everything that's going on end to end. And some people say it's wrong, but I think in a young company, I like to understand everything. That doesn't mean I do everything. aware of what happens in finance or in legal parts of the product or in tech, obviously, but I need to understand it end to end, and that always helped me. So I always measure a bit, like, do I have things under control with the, at his approach. And then in terms of work style, I have to say the early pre-erratic Elon Musk, I have to honestly admit it. I mean, by now it's a different story, but in the beginning, this whole work yourself there and understand it a lot, crunch it, and also in terms of team, have rather small teams of super concentrated superstars that also like working with you, then that's certainly a source of inspiration. And I sometimes measure if that happens. And also I have to say there is this anti-person, not persons, but approaches. Like when big corporates and then you have these situations where you realize, okay, it's not a person that is anti-inspiring me, but a setup. up. And yeah, this combination kind of gives me the compass.

Noah Labhart

Alex, last question. So you're getting on a plane and you're sitting next to a young entrepreneur who's built the next big thing. They're jazzed about it. They can't wait to show it off to the world. And can we show it off to you right there on the plane? What advice do you give that person having gone down this road a bit in a couple of different ways?

Dr. Alex Kihm

If they already built the greatest thing, I'm not sure they would listen. I would tell them, never fly too close to the sun. If you burn yourself, you might crash into the next rain, and after rain comes sunshine, and when the sun is back up again, don't throw away the umbrella. Simple as that. But I think it's very abstract, but you get it. There will be ups and downs, and always there will be ups and downs, and it's not this old, it's not about you fall, it's about how you stand up. But it's more, don't throw away the umbrella once things are running. Expect the next rain, but you can also know that afterwards it will be sunshine, but next time you have the umbrella. So You're not a wet.

Noah Labhart

I love it. I think that's fantastic advice. Well, Alex, thank you for being on the show today. Thank you for telling the creation story of POMA.

Dr. Alex Kihm

Thank you.

Noah Labhart

And this concludes another chapter of Code Story. Code Story is hosted and produced by Noah Labhart. Be sure to subscribe on Apple Podcasts, Spotify, or the podcasting app of your choice. a chance, leave us a review. Both things help us out tremendously. And thanks again for listening.

Transcribed with Whisper and reviewed for names and terms; speaker labels are automatic and may contain small errors. Timestamps link to that moment of the transcript.