<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tuomas Ritola on Medium]]></title>
        <description><![CDATA[Stories by Tuomas Ritola on Medium]]></description>
        <link>https://medium.com/@tuomasritola?source=rss-6583749683d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mU97AQ-v9mw7u2w_Mr_hHQ.jpeg</url>
            <title>Stories by Tuomas Ritola on Medium</title>
            <link>https://medium.com/@tuomasritola?source=rss-6583749683d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:10:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tuomasritola/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What makes document search hard?]]></title>
            <link>https://medium.com/spxfiva-data-science/what-makes-document-search-hard-2225107e2bda?source=rss-6583749683d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2225107e2bda</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[suptech]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Tuomas Ritola]]></dc:creator>
            <pubDate>Wed, 28 Aug 2024 06:38:05 GMT</pubDate>
            <atom:updated>2024-08-28T06:38:05.342Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*MysQ4-kdb8Ra42gd7EMIQw.jpeg" /><figcaption>A common sentiment in software development, but something we hopefully avoid by at least mindfully contemplating on the difficulty beforehand. <em>[Photo originally b</em>y <a href="https://unsplash.com/@iswanto?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Iswanto Arif</a><em>]</em></figcaption></figure><h3><strong>Why is internal document search with LLMs challenging? Insights from FIN-FSA’s development</strong></h3><p>As the craze around <strong><em>RAG</em></strong> and/or <strong><em>Chat with your documents</em></strong> solutions shows, internal or <strong>document</strong> <strong>searches seem to be among the most interesting use cases for LLMs</strong> in organizations.</p><p>But as there are still no successful products resulting from the said craze, it might imply that making effective, usable search solutions <strong>is in fact quite hard</strong>.</p><p>We are no different at the Finnish Financial Supervisory Authority (FIN-FSA); search-related use cases are clearly among the most popular and most valuable-seeming use cases. And despite the potential difficulty, one of our focus areas in AI-related development is working on an <strong>effective internal document search for supervision purposes</strong>.</p><p><strong>So what is it that makes search hard?</strong> At first glance, using LLMs for internal document searches within for example sets of financial regulations might seem straightforward — just go ahead and implement an off-the-shelf RAG tool. However, the reality is quite complex, and here are some challenges we have come across.</p><h4>Text extraction</h4><p><strong>Extracting the text from documents</strong> accurately. The documents can be a mix of pdf, docx, ppt, and html documents, all of which call for somewhat different treatment. In addition, PDFs are a mess in their own regard, and you should think whether you need to approach the extraction as a machine vision problem. Luckily LLMs are starting to handle information extraction from images of documents increasingly well!</p><h4>Retrieving relevant content</h4><p>Having the search <strong>return relevant matches</strong> or similarities. In many cases your vector search performance will benefit from finetuning the embedding models used with your own, curated domain data, and often quite some attention needs to be paid on the way the extracted text is split into parts for indexing, or whether you should index the document pages as images separately. Vector search alone is often, however, not enough — but you should rather turn to…</p><h4>Hybrid searches</h4><p>…using a <strong>hybrid approach</strong>, a combination of nearest neighbour search and a classic keyword/BM25 search. If you look for a specific piece a regulation like “600/2014”, a pure NN search can be totally useless, since tokenization messes things up. Or conversely, a symbolic search for “AML” might not return documents containing the phrase “anti-money laundering” written out in full. In the end you’ll end up with all the challenges (and solutions!) of classical information retrieval PLUS the intricacies of using LLMs in production.</p><h4>Search UX</h4><p>Then, the <strong>user should be able to influence what the search does</strong>. And if you add more RAG type functionalities, the user might be easily lost in how to get the tool to do what they want. So, in terms of the search UI, the user should be able to manage the different options of the search, to control the search space, and in the case of a RAG pipeline, also curate the retrieved context, AND have an easy access to the retrieved chunks in their original document context.</p><h4>User understanding</h4><p>And to be able to handle all this, the <strong>user should also understand how the search works</strong> behind the scenes. This means providing the user with clear and concise explanations of the search mechanics, perhaps through an interactive tutorial or well-designed documentation. The user should understand whether they are performing a vector search, a keyword search, or a hybrid search, and how their inputs will influence the results. This transparency not only enhances user experience but also builds trust in the system’s capabilities.</p><h4>Scalability</h4><p>Another significant challenge is <strong>ensuring the scalability</strong> and efficiency of the search solution. As the document corpus grows, so does the complexity of maintaining fast and accurate search results. This might require optimization of the indexing process. Performance tuning becomes crucial, especially when dealing with real-time queries that demand swift response times.</p><h4>Security</h4><p>Lastly,<strong> security and compliance</strong> cannot be overlooked, particularly when dealing with confidential documents. This involves implementing strict access controls and encryption to safeguard data integrity throughout the search process. Additionally, the system must comply with industry standards and regulations, such as GDPR, which potentially adds another layer of complexity to the search solution.</p><h3>Conclusion</h3><p>All in all, an effective document search has multiple challenging dimensions. And as noticed already in earlier projects, an AI/ML/LLM project in most cases will consist of massive amount of everything outside of the sexy AI work — UX development, data pipelines, infrastructure work etc.</p><p>One additional thing that highlights the difficulty of building a good search are the experiences from significantly bigger players. Despite the significant investments for instance in some social media platforms, the user experience of searching for posts can still be quite bad, illustrating the challenges of implementing search functionalities even with seemingly straightforward text formats.</p><p>If tech giants struggle with search, how could we succeed?</p><p>Well, eventually time will tell, but at least we have the scale on our side — we start from supporting the work of a handful of experts, in limited contexts, with limited search spaces, and trying to maximize the users’ understanding of what the search can and cannot do. And luckily many of the intended search functionalities can be tested for example in notebook settings before investing heavily on the development of a fully functioning search application.</p><p>So, one of the next blog posts might then be either <strong>How We Built a Successful Document Search </strong>or <strong>Why Document Search Is Indeed Really, Really Hard — PART 2.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2225107e2bda" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spxfiva-data-science/what-makes-document-search-hard-2225107e2bda">What makes document search hard?</a> was originally published in <a href="https://medium.com/spxfiva-data-science">SPxFiva Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Frontier: Utilizing Large Language Models at FIN-FSA and Bank of Finland]]></title>
            <link>https://medium.com/spxfiva-data-science/exploring-the-frontier-utilizing-large-language-models-at-fin-fsa-and-bank-of-finland-7d69e550ed94?source=rss-6583749683d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d69e550ed94</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[suptech]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Tuomas Ritola]]></dc:creator>
            <pubDate>Tue, 26 Mar 2024 11:36:56 GMT</pubDate>
            <atom:updated>2024-03-26T11:36:56.307Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xZaz4ME-PqwjMAleAE9W0A.png" /></figure><h3>Introduction</h3><p><strong>Analytics Center of Excellence</strong> (or <strong>ACE</strong>) — a joint data science hub of the <strong>Finnish Financial Supervisory Authority (FIN-FSA)</strong> and the <strong>Bank of Finland</strong> — implemented during the latter half of 2023 a pioneering project for exploring the potential of Large Language Models (LLMs) for making operational processes and expert work more efficient. The initiative marked the first of its kind, aiming to deepen the understanding of LLM applications in real-world scenarios and to discover how automation and AI could streamline the handling and creation of (mainly) textual data and documents within the two institutions.</p><p>The Finnish Financial Supervisory Authority (FIN-FSA) regulates and oversees financial institutions in Finland, ensuring the stability and integrity of the financial system and protecting consumers. It is responsible for monitoring compliance, enforcing regulations, and preventing financial crimes.</p><p>The Bank of Finland (BoF), as part of the Eurosystem, plays a crucial role in formulating and implementing monetary policy to maintain price stability. It also ensures financial stability, conducts economic research, produces statistics, and attends to the settlement of interbank payments and investment of its own financial assets.</p><p>Given the substantial volume of textual material that both organizations deal with — ranging from analyzing reports and legislation to producing extensive documentation — the potential for efficiency gains is significant.</p><blockquote>LLMs have the potential to <strong>enhance experts’ efficiency</strong> in many tasks or <strong>expand the range or scope</strong> of tasks they can undertake, currently limited by their available time and resources.</blockquote><h3>Project objectives</h3><p>The primary goals were straightforward:</p><p>1. <strong>To explore the potential of LLMs</strong> in the context of FIN-FSA and BoF contexts and to identify opportunities where these models could automate or simplify task</p><p>2. To <strong>build root level expertise</strong> around the practical use of LLMs for different use cases</p><p>3. To <strong>understand the requirements and limitations</strong> of using LLMs in the contexts of financial supervision and central banking.</p><h3>Approach and limitations</h3><p>The project’s exploratory nature meant that all development and testing phases utilized publicly available data. This approach, while restricting the scope to a degree, facilitated a faster learning curve and allowed for more agile development processes. Despite these constraints, the project successfully tested a variety of use cases, each offering insights into the practical applications and limitations of LLMs in a regulatory and financial context.</p><h3>Key themes explored</h3><p><strong>1. Intelligent Search and Retrieval</strong></p><p>Many experts’ tasks both at FIN-FSA and at BoF revolve around reading and analyzing text documents — a supervisor might go through hundreds of pages of document in an inspection, an economist or a researcher might analyze literature on a given topic in order to write a new article, or a lawyer might read through different regulations and their preparatory work and materials when deciding on an interpretation regarding a nuanced matter.</p><p>In the LLM PoC, we tested sophisticated search pipelines, capable of parsing through vast amounts of public documentation, such as annual reports, marketing materials and regulatory texts. The main use cases explored here had to do with both, generating direct answers to user questions and queries, and retrieving relevant document sections for a user’s question, topic or a theme in enhancing efficiency in information retrieval tasks.</p><p><strong>2. Automated Document Generation</strong></p><p>Organizations like FIN-FSA and BoF both process and produce large volumes of text documents. They receive reports from various stakeholders, and often, their responses to communications, inquiries, or applications take the form of documents, such as official decisions. Documents as the outputs of an authority’s processes range from simple decisions with nearly boilerplate text to highly complex, resource-consuming legal decisions or interpretations. Especially in the simpler end of the spectrum, there is plenty of expert effort to be retargeted to more useful work if an LLM would generate a draft document with all the metadata and (at least) a draft of the body text in place.</p><p>By automating the creation of .docx document drafts based on for example stakeholder application emails, the project demonstrated LLMs’ potential to save time and reduce manual input in routine tasks. This automation would aim to streamline processes where the outcome is relatively predictable, based on the content of the application texts.</p><p><strong>3. Generating data for LLM evaluation and development</strong></p><p>When using LLMs, it is imperative to be able to <strong>evaluate</strong> and <strong>improve</strong> the tools and methods we develop. Here generating data for LLM development presents another valuable way to utilize LLMs.</p><p>Firstly, if we develop, say, a search pipeline for supervision documents, we need to evaluate the performance of the system to assess whether the system can find what the user is after. Secondly, when we find the performance of the system lacking in some respect, we also have the option to further train or finetune the models used. For both of these cases, you rarely find high-quality data for evaluation or training purposes, but rather, we often need to either manually create or label the datasets, or produce the datasets automatically using e.g. an LLM.</p><p>In the PoC, we worked on producing datasets based on public research articles from Bank of Finland. In practice, based on chunks or excerpts of domain documents, we generated synthetic, queries or questions relevant for that particular chunk. These chunk + relevant query pairs can then be used both in finetuning domain-adapted LLMs — that is, make them understand better the language used in each domain.</p><p><strong>4. Code Generation</strong></p><p>Modern economists and supervisors have diverse sets of skills, including data science and software development. The ability of LLMs to generate code is especially beneficial for experts with programming skills, enhancing their data science workflows, such as data manipulation in Python. Additionally, economists can leverage LLMs for more specialized code generation tasks beyond Python development assistance.</p><p>A more custom case of code generation on LLMs was the development of a system to generate time series codes from natural language descriptions and vice versa. This feature aimed to simplify interactions with the Bank of Finland’s <a href="https://www.suomenpankki.fi/en/statistics2/statistics-info/whats_new/2023/using-the-open-data-service-interface/">open data service</a>, making data more accessible to users without technical expertise in querying databases.</p><h3>Technology stack</h3><p>The technologies used in the LLM POC include GPT-models available on Azure OpenAI, Mistral Cypher 7B as an open source, locally hosted LLM, Weaviate and Azure AI Search (formerly Cognitive Search) as the vector search frameworks, Llamaindex as a data framework, LLM Sherpa for making sense of tabular data using LLMs, and Streamlit for prototyping user interfaces.</p><h3>Findings and implications</h3><p>The project’s findings were promising; LLMs demonstrated clear potential in enhancing search functionalities, but also highlighted the importance of UI/UX designs, tailored to different use cases, in ensuring the utility and user-friendliness of search tools.</p><blockquote>Plain <em>chat with your PDFs </em>applications or Retrieval Augmented Generation (RAG) pipelines are seldom what the experts need, but rather they may have a more specific need for example for extracting specific information over a large dataset and synthesizing the dataset level findings.</blockquote><p>This is something that the vanilla RAG solutions cannot handle, but instead require more tailored approaches or additional layers of metadata generation or reasoning.</p><p>In addition, the exploration of model selection and fine-tuning revealed the considerations necessary for optimizing performance and costs of productizing these models, particularly in a multilingual context. Finetuned GPT-models showed clear promise but running them at scale might turn out to be costly, especially with a more active usage.</p><p>In terms of model selection and customization, most of the testing relied on Azure’s OpenAI GPT-4, although experiments with open-source alternatives like Mistral Cypher 7B were conducted. The project’s focus on Finnish language tasks suggested GPT-4 as the most viable option, though future exploration might include models specifically trained on Finnish datasets.</p><blockquote>The project also underscored the critical role of generating evaluation datasets and finetuning embedding models to refine search and retrieval results.</blockquote><p>When evaluating the hit rate of a vector search implementation, we found that finetuning has a clear impact on the performance of for example embedding models, and finetuned smaller models, like Sentence-BERT, can beat off-the-shelf LLMs like OpenAI’s text-embedding-ada-002. Hence, when designing production search systems based on LLMs, finetuning on domain data should be always considered as a crucial step.</p><h3>Future directions</h3><p>The goal of the LLM PoC was to explore the possibilities of the LLM technologies and identify the most suitable avenues for further development — meaning that no production solutions were developed during the project.</p><blockquote>However, in our internal analysis of tasks within FIN-FSA, we’ve discovered more than 70 ways AI and large language models could be used to facilitate the experts’ work or for example to broaden the scope of the materials included in a supervisory task. This opens exciting possibilities for future applications, which in our case will most likely focus on improved search functions and automatic document creation.</blockquote><p>Looking ahead, advanced LLMs such as Google’s Gemini 1.5 and Anthropic’s Claude 3 are showing great potential. These models can handle contexts longer than GPT4 and show clear promise to enhance understanding of longer documents beyond just piecing together information from document snippets. And based on social media speculations, the publication of GTP-5 might be close, with presumably similar functionalities!</p><p>All in all, the project laid a foundation for further development, emphasizing the need for continued investment in AI capabilities as part of a broader data and AI strategy. The internal data sources of both Bank of Finland and FIN-FSA are rather unique and depending on commercial solutions to enhance AI-driven capabilities, such as understanding data, discerning patterns, and generating metadata, could lead to potential challenges in the future. Further, relying solely on externally trained models might introduce an unwanted bias to the analyses, depending of course on how the models are utilized.</p><h3>Conclusion</h3><p>This project represents a significant step towards integrating advanced AI and machine learning technologies within the FIN-FSA and the Bank of Finland. By leveraging LLMs, both institutions have the possibilities for making operations more efficient and help the experts focus on the tasks that bring the highest value for the organizations’ tasks.</p><p>The lessons learned and the groundwork laid by this initiative promise to guide future projects, further bridging the gap between technology and traditional financial oversight functions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d69e550ed94" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spxfiva-data-science/exploring-the-frontier-utilizing-large-language-models-at-fin-fsa-and-bank-of-finland-7d69e550ed94">Exploring the Frontier: Utilizing Large Language Models at FIN-FSA and Bank of Finland</a> was originally published in <a href="https://medium.com/spxfiva-data-science">SPxFiva Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>