Welcome back listeners. Today we are dropping another special episode of the Code Story podcast as part of our series entitled Beyond Bots, the real impact of AI on financial services brought to you by our friends at Ntropy. As a reminder, Ntropy is the most accurate financial data standardization and enrichment API. They can take in any data source, any geography, and understand slash enrich a a financial transaction in milliseconds. Made for developers for fast, easy implementation. Check out their product at Ntropy.com. Well, today I have another special guest on the Code Story podcast, Ilia Zintchenko, CTO and co-founder of Ntropy. Ilia, thank you for being on the show today.
Thanks for having me on.
Absolutely. Really excited to chat more about Ntropy and language models. But before we get into that, tell me in the audience, little more about you.
So yeah, I'm the co-founder and CTO of Ntropy. Launched in the market about two years ago, initially from London, and now we kind of have something like three offices between Portugal, London, and New York. At Ntropy, we're kind of helping other fintechs and banks and new financial companies to understand their customers better from their financial data, whether this is bank transactions or accounting data invoices marketing data obviously probably most of my time i spend a few in front of a screen either writing code or you know going through some spreadsheets and stuff like that right also doing some coding on the side i like to do rock climbing i like to do chess so potentially we have this kind of chess tradition that uh we we have this chess tournaments and the rest of the team also really like traveling i've been living in various parts of the world around Europe, but also in Seattle, New York, UK, Switzerland, Norway, Russia. Currently on the west coast of US, staying here for a few months, and then moving back to New York where I'm most of the time.
Okay, well, let's dive in a little bit more of the meat then. So we talked with Nare about Ntropy and large language models, but I want to dig in a little bit more. Tell me, as CTO, tell me what your LLM stack is and how you went about choosing it. and figuring out what tools you were going to use. So
Ntropy was always kind of a natural language, machine learning, language models company. Our stack from day one was always really about language models of different types, of different sizes. Ultimately, the goal is to write initially kind of our API was extracting merchant names from banking data. Now it does much more than that. But yeah, all of this is very much language model powered. initially when we kind of started researching this topic in like 2018-19 it was kind of all about transformers but the language models we used were much smaller than i guess kind of the current large language model sizes that are popular today so our models had like something like 100 million parameters throughout the pipeline and these models are of course cheap to to train, they're cheap to run. But then on the other side, there's, of course, accuracy and kind of robustness, reliability, which is sometimes a trade-off. As we have evolved this and kind of, you know, with the advent of larger and larger language models and different tricks you can do with transformers, we have kind of pushed the boundaries of all of these things, right? Like kind of cost per transaction, right? Like how expensive it is to process a single unit of data, actual transaction. There is, of course, the accuracy, but then there is also latency, how quickly you can do that. And then also other things, right? Like reliability and returning the same response for the same input all the time. So there's actually multiple dimensions across which we're optimizing things. And the general trend is, yes, Yes, large language models have this kind of unique ability to reason about things, common sense, maybe, if you will. But then it's very expensive to run, right? And sometimes not very moldable or tunable. So, yeah, so at Ntropy, it's really all about how do we bring this performance and reasoning ability of large language models into a stack, which needs to process hundreds of millions and billions of transactions per month at a reasonable cost. Yeah, and that kind of involves some of the usual suspects like model distillation, like layer fusing, quantization, different things like that, but then also playing around with different architectures and different caching methods, right? If you have seen a transaction previously that is very similar to this one you're seeing now, do you really need to run everything on it? Or can you actually reuse some of the computation you have done previously? So this is kind of some of the things we're working on.
That makes sense. And there's a lot of variables there. And I hear you optimizing around architecture and reliability and things like that, right? The four factors and then also around building it in a smart way so that it's not overly expensive. cost are we talking about here? Like, is it primarily compute? Is it infra? Is it a mixture of both? Give me a little bit more context there.
The two largest factors there are the cost of cache, right? So in-memory caching, which is quite significant. The other cost is compute, GPU costs. These two costs are also tied together, actually. You can imagine if you see something like a transaction or an invoice, which at one point of time, right, you spend some compute to process it. And then the question is, like, how long are you going to store it for store this result, which you may or may not reuse in the future, right? If it's like a transaction, which is which is really odd, and you're unlikely to see this anytime soon, you might actually decide to not store it, right? Because ultimately, in memory storage on the cloud is you effectively pay like that you store something, right? Per second per megabyte, let's say, right? And so a big factor here is like the trade-off between storing something for X amount of time and then maybe instead just chucking it away and recomputing it later, right? So there's like that variable, which we're also optimizing. But yeah, GPU costs and caching costs is the two dominant factors there.
That's really interesting. I wouldn't have thought about the caching costs, but that makes sense. You know, in your previous answer, you mentioned reliability. How do you optimize for reliability and how do you measure that? What sort of levers are you pulling to ensure that your model is reliable?
Metrics is also a whole area which is very important for us, including reliability. We have a dedicated team of people which are responsible for this. It's many factors here. Every time you send the same input to our pipeline, you would want to expect the same output, right? which is a big part of reliability, right? And even that might, I guess, sound trivial, but we also need to realize, right, like there's a big part of our stack is not only models, but also like merchant databases and search engines and also these caches, right, which each entry in the cache has some kind of time to live, right? It will be deleted after some point. But at the same time, we still need to make sure that when a customer sends something and they send something again, right, they expect to see the same thing, right? So this is one part which we have live testing for. We have some kind of fixed sets of transactions, which we're periodically running through and verifying that the output is still the same. And if it is different, we kind of flag that and investigate what happened, right? Which does not happen often, but it happens sometimes, right? When we change different parts of our stack. There is also, which is, I guess, also part of reliability, like robustness, right? Like when you see a similar input four, right, maybe with like a reference number is different or something insignificant, right, like a different card number or a slightly different address, then you still want to probably expect the same output, right? So how do we manage this potential instability, right, with slightly different inputs? That is quite actually common with machine learning models in general, also common with language models of any size. Although we have actually seen that the the language model, actually the more robust it is to these kind of things, right? Which is interesting.
Okay, well, let's switch gears a little bit. For you guys at Ntropy, how are you thinking about predictive versus generative learning?
That's an interesting question. And I guess like a big part of the machine learning community has probably been asking this question too, like in the last couple of years, right? With the advent of these GPT models and later later open source language models, which are all, or most of them are generative, effectively kind of trained on lots and lots of kind of human-made text data, ultimately just to be able to predict the next token, right, in a piece of text. For generative models, I think an easy way is to imagine it as like a superset of these predictive models, right? A predictive model is from a fixed type of input, it is trained to produce a fixed output, right? Like a category, for example, right? If you're training like a classifier or like a regression model. But then generative models are able to kind of fill in the blanks, if you will. Like the input can be any subset of your data. And then the model is simply then trained to kind of fill in the missing pieces, right and the missing piece can be like the next word in your text but it can also be words somewhere in the middle of your text right and so generative models are more flexible but at the same time that of course comes with like a much larger complexity space right usually they take longer to train than predictive models but then this kind of emergent reasoning ability of very large language models that we have seen i think is very likely because they are generative right not just classifiers. We're quite excited about this flexibility that generative models give. But yes, sometimes it's, you know, of course you still have like hallucinations and stuff like that, right? Like if the model starts to generate something wrong, it then assumes that the wrong thing it generated is actually correct. And then it's kind of go off and produce a nonsense. So they have to be tamed in an optimal way.
I like the word hallucinations applied to the generative learning. That's interesting. Ntropy has been doing, you know, has been using small and large language models since the beginning. You know, we touched on this a little bit with Nare, but I'm curious to your perspective, why is that significant? Why is it significant that you and your team have been using language models from very early?
I think in kind of the problem Ntropy is solving is not really new. A lot of the initial techniques to do this was kind of based on this merchant lookup tables and and these rules-based approaches, and also humans, right? Who just look through bank statements and verify that everything is reconciled correctly and everything. The problem we're solving is not novel, but the approach we're taking to solve this problem has only really been possible after the advent of transformer models in 2017-18. A lot of the current players in this market are still pushing this rules-based agenda, which we believe is very performance-capped at a certain point. And you're just not going to be able to get the important edge cases and things like that with just rules. So language models are really, really key here. But yeah, also at the same time, what I mentioned in the beginning is you cannot spend $1,000 to understand a single bank transaction, right? on the area where you apply this information to, right? Like whether it's like personal finance management or business underwriting or business finance management or credit or risk, right? So the value of each, let's say bank transaction varies. And so sometimes you can spend more effort to understand this data more accurately. But in any case, cost really, really matters. And yeah, machine learning models are not cheap. And so what we're doing here is kind of, you know, giving you both at Ntropy, right? Like, so keeping the costs not much different than this traditional rules-based systems whilst giving you the performance of, well, effectively large language models for this domain, right? Which is kind of the secret sauce in a way. Okay,
let's switch to data sources then. So what sort of data sources have you been using, you know, to run through your models and build your models? And I'm curious if there are some that are better than others, you know, and maybe that has to do around, you know, completeness of data or cleanliness. But tell me, tell me your perspective there.
So data sources is a big one. So you can imagine to properly understand this data, you need to know information about the real world, right? You need to know, like, what is a Walmart, right? You need to know, you know, what is subscription to Spotify or something like this, right? What is Spotify? You need to know about merchants. You need to know about locations. in the real world. You need to know what are dates and person names, which also sometimes appear in transactions. So this data is very, very much tied to real-world data. And so to process it, you respectively also do need to have location lookup tables, merchant databases, various kinds of search engines and APIs, which we're all combining in our stack. But at the same time, there's really like no, or at least we haven't found it so far after, you know, years of searching like a holy grail merchant database, which has all the companies in the world perfectly categorized and updated. There is many merchant databases out there, right? But none of them are perfect. Lots of them are themselves built up by just scraping the web, scraping the websites of different companies and trying to extract information from there. And I mean, we're also doing a lot of the scraping ourselves and combining that with buying databases in bulk and trying to denoise things ultimately about each entity, right, or company or merchant. We're just trying to get information from as many sources as possible to piece together what is really the truth, right? Because sometimes one database would say a company is doing one thing, whilst another database is saying the same company is doing something else, whilst in reality, this company has been closed three years ago, right? So there is a lot of kind of entity linkage that we're doing. The other part is, of course, the financial data itself, like transaction data and invoices and bank statements, right? This data also tells you a lot about the entities involved. You know, like one company is paying for a service provided by another company or like a person is buying something from a shop. And so internally, we're also building this kind of payments graph of transactions, right? And using this graph itself to try to infer what is the likely subscription cost of a certain merchant without even going to their website. So you can also extract a lot of this information from banking data itself. And so we're doing both, training and fine-tuning our models on this.
That's fascinating. I think that's a really interesting part of it with the data sources, how you have to position them and clean them, what sources you get them from, etc. And then fine-tuning from there. I think that's really, really interesting. So I'm curious, you've been doing this since the beginning. What would you go back and do differently if you could reset a couple of things? Maybe it's something that even worked, but maybe you'd tweak it a little bit. Tell me a little bit there.
There is a few things. I think one, if I were to do it again, I would invest more in our labeling data with humans. Of course, now we do have quite a large human labeling team with advanced internal in-house kind of tooling and in different ways to like cluster and surface edge cases and look at confidence scores and things like that. But I would invest in that a bit earlier than we did. Initially, we tried to rely on some external labeling solutions, but the quality to not only quality to price, but in general quality there was just not really acceptable. waited a bit too long to build to build out an internal in-house labeling team and of course right like without human labels in general it's even hard to have any sort of performance metrics or any ground truth right so it's really essential not only to train your models right but also even to monitor quality in in real time another thing we didn't invest very heavily in machine learning capabilities really from from day one most of our engineering was was kind of algorithms people but it would have been great to maybe also get the other part like kind of the the ux things right of like like documentation and like the the kind of the customer facing pieces of our pipeline smoother right and be nicer from uh from an earlier time than we did we were very very focused on kind of performance and metrics and latency and uptime and things like that. Let's say like onboarding cycle, right? Like for, for customers and things like that. So investing in that earlier than we did would have been more efficient, but, but of course now, now we have all of that nice and shiny. So.
Well, Ilia, I really appreciate you being on the show. I've learned a lot from our conversation, you know, a little bit deeper into how Ntropy is using LLMs, the stack you're using, how you're optimizing costs and how you're optimizing the learning there, paying attention to reliability and how important data sources is in this whole process. Really appreciate you being on the show. Thank you,
Noah. This was a pleasure. Great chatting.
Wow. Fascinating conversation with Ilia. A lot more depth into Ntropy's approach with language models. I found it really interesting to dig into system cost optimization around the factors of learning, reliability, and I can quickly see how important it is to have clean, robust data sources to train your models on. As a reminder, you can learn more about Ntropy and get started enriching your FinTech transactions today by visiting Ntropy.com and clicking Start Building. And thanks again for listening.