<?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 Aleks Konstantinov on Medium]]></title>
        <description><![CDATA[Stories by Aleks Konstantinov on Medium]]></description>
        <link>https://medium.com/@alkons?source=rss-9e811d99bd4a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*pjawArDRasRdHPLnbojhAQ.jpeg</url>
            <title>Stories by Aleks Konstantinov on Medium</title>
            <link>https://medium.com/@alkons?source=rss-9e811d99bd4a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:04:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alkons/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[LLMLingua for reducing cost of audio assessment tasks]]></title>
            <link>https://medium.com/innova-technology/llmlingua-for-audio-assessment-tasks-0d61a80047f4?source=rss-9e811d99bd4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d61a80047f4</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[audio-assessment]]></category>
            <category><![CDATA[llmlingua]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Aleks Konstantinov]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 08:01:15 GMT</pubDate>
            <atom:updated>2024-01-10T15:36:23.708Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi All, My name is Aleks. Our company is building an audio assessment platform, <a href="https://ai.innova-technology.com/aidi/">AIDI</a>. In this article, I’d like to share my experience with an attempt to reduce OpenAI costs using the LLMLingua framework.</p><h4><strong>Audio </strong>Assessment</h4><p>Leading Voice-to-Text solutions in combination with the latest LLMs allows us to assess conversations using dynamic business criteria that match the business needs and change as the business grows, which opens up a wide range of possibilities for controlling the call center. This was not possible with old-fashioned statistical analysis, where we could only analyze the emotional aspects of the conversation.</p><p>On the top level, it works using the following algorithm:</p><ol><li>Transform the audio to text using voice-to-text model</li><li>Use LLM to assess the conversation text</li></ol><p>Check out the <a href="https://github.com/RaftDigiAI/audio-insights-min">open source solution</a> to see how this case works in action.</p><h4><strong>LLM usage considerations</strong></h4><p>LLM’s, especially GPT-4, come with a great opportunity to empower the model for different tasks. However, there are several things to consider when we are using them for audio assessment tasks.</p><p><strong>Prompt length limits</strong></p><p>Audio conversations, especially meeting recordings, might be too long. Each model has context-window limitations, such as hard limits, as well as the <a href="https://twitter.com/swyx/status/1722441535235768372?s=20">model&#39;s ability to forget some facts</a> when the context window is fully utilized.</p><figure><img alt="Found facts count depending on the context window size" src="https://cdn-images-1.medium.com/max/547/1*ly6m6BWRWK8TCoalMZWHkQ.png" /><figcaption>Found facts depending on the context window size</figcaption></figure><p>GPT-4 Turbo attempts to fight this limitation with a 128k window; however, it works best when the context window is less than 8k tokens.</p><p>We could avoid this data loss by using the map-reduce algorithm for the long conversation assessment or by compressing the prompt.</p><p><strong>Cost</strong></p><p>GPT-4 models cost a lot, and the final bill after analyzing 10,000 conversations can be painful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1cEsd4VClD3azVpZGN7Xgg.png" /><figcaption>Cost estimate for analysis using Open AI models</figcaption></figure><p>We can consider using GPT-3.5 for such tasks, but it leads to precision loss due to the bad reasoning of the GPT-3.5 model.</p><p>The good idea would be to reduce the number of tokens used for the analysis of each conversation. This will help us get the best results out of the model by using only the first 8k tokens and reducing the bill.</p><p>This is why a research paper from Microsoft <a href="https://arxiv.org/pdf/2310.05736.pdf"><em>LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models</em></a> caught our attention. The researchers were able to reduce the number of tokens by 20x with minimal data loss. It sounds ambitious and promising.</p><h3>LLM Lingua</h3><p>LLMLingua utilizes a compact, well-trained language model (e.g., GPT2-small, LLaMA-7B) to identify and remove non-essential tokens in prompts. This approach enables efficient inference with large language models (LLMs), achieving up to 20x compression with minimal performance loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9St_FwIv-LXN6BIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8I8u3-bdVS4_ra_k.png" /></figure><p>Repo <a href="https://github.com/microsoft/LLMLingua">https://github.com/microsoft/LLMLingua</a></p><h3>Experiment</h3><p>For experiments, I’ll use the benchmark created for the AIDI product. It helps us run experiments with different prompts, algorithms, and LLM models.</p><p>It has 12 dialogues under the hood and assesses each dialogues with six questions, which should be answered yes or no. We split dialogs into two categories:</p><ol><li>All questions for first six dialogues should be answered as yes</li><li>All questions for the rest of the dialogues should be answered as no.</li></ol><p>Finally, we calculate the total LLM score.</p><p>LLM Model used — GPT 4 Turbo.</p><p><strong>Compression code</strong></p><p>I’ll be running the compression model on the CPU, so here is the instruction on how to do that.</p><p>First, we have to install two dependencies:</p><ol><li><a href="https://pypi.org/project/llmlingua/">llmlingua</a></li><li><a href="https://pypi.org/project/accelerate/">accelerate</a></li></ol><p>Then compress the prompt using the following code. This code will provide the default 2x compression.</p><pre><br>llm_lingua = PromptCompressor(<br>    model_name=&quot;NousResearch/Llama-2-7b-hf&quot;,<br>    device_map=&quot;cpu&quot;  # Device environment (e.g., &#39;cuda&#39;, &#39;cpu&#39;, &#39;mps&#39;)<br>)<br><br>compressed = llm_lingua.compress_prompt(prompt)<br>compressed_prompt = compressed[&quot;compressed_prompt&quot;]Conclusion</pre><p>On the first start, the library downloads the required models. It took about an hour.</p><p><strong>Compressing entire prompt</strong></p><p>In the first experiment, I tried to compress a prompt as well as a conversation. It took 15 minutes to compress 2,000 tokens using an i5–12400F CPU.</p><p>After compression, LLM answered that it couldn’t understand the instruction and asked to provide clear instructions.</p><p>So, the compression broke the instruction entirely.</p><p><strong>Compressing conversation</strong></p><p>In the second experiment, I tried to compress only a conversation.</p><p>The instruction worked now, but the precision of the assessment was only <strong>30%</strong>, compared to <strong>93%</strong> without compression. This means we lost a lot of context during compression.</p><h3>Conclusion</h3><p>The idea behind LLM Lingua is natural and ambitious. Unfortunately, currently we can’t utilize the framework for audio assessment because it leads to critical data loss for our scenarios.</p><p>Also, it requires powerful resources to run the library. We can’t go to production with the CPU and need to run the model on something powerful like an NVidia A100 CPU, which will lead to a bill increase if you don’t have your own infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d61a80047f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/innova-technology/llmlingua-for-audio-assessment-tasks-0d61a80047f4">LLMLingua for reducing cost of audio assessment tasks</a> was originally published in <a href="https://medium.com/innova-technology">Innova company blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Slack Power BI integration]]></title>
            <link>https://alkons.medium.com/slack-power-bi-integration-1850ef108d53?source=rss-9e811d99bd4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/1850ef108d53</guid>
            <category><![CDATA[slack]]></category>
            <category><![CDATA[slackbot]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[akvelon]]></category>
            <dc:creator><![CDATA[Aleks Konstantinov]]></dc:creator>
            <pubDate>Mon, 08 Feb 2021 20:18:38 GMT</pubDate>
            <atom:updated>2021-02-08T20:18:38.785Z</atom:updated>
            <content:encoded><![CDATA[<p>Since its official release over five years ago, Microsoft’s Power BI has helped millions of people around the world leverage their data to tell compelling stories through data visualization.</p><p>Power BI is a data science application developed by Microsoft that can be used to load, process, and most importantly, visualize data. Wanting to help Power BI reach an even broader audience, Akvelon sought to integrate Power BI with Slack so that the 10 million daily active users on Slack would have better access to Power BI’s data visualization tools. The service is presented in the form of web, desktop and mobile applications. Additionally, we decided to integrate Power BI with Slack specifically for a several reasons:</p><ul><li>Convenient functionality without unnecessary tools things.</li><li>Uniform interface across all versions of the Slack app.</li><li>The reports are immediately visible to the entire team.</li><li>Much easier process</li></ul><p><strong>From Slack to Power BI and Back</strong></p><p><strong>Currently, </strong>there are more and more services with a confusing interface and huge capabilities that most users don’t find useful. Our goal was to simplify interaction with the Microsoft Power BI system using the already- familiar Slack. In our application, you can request a report with the selected parameters at any time and receive it in the Slack channel or private messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8gjAQ0inCxdG3akYOW2nSg.png" /><figcaption>Power BI report</figcaption></figure><p>As mentioned, the main feature of Power BI is the ability to visualize data, so we decided to send a screenshot of the report to Slack with a link to the source. To do this, we had to completely repeat the user’s work process: — open a browser and select the desired parameters.</p><p>We found that our application consists of two main parts — interaction with Slack and interaction with Power BI. We’ve implemented our API where requests from the Slack user are processed and redirected to the Power BI service. We then saved the resulting report locally, and sent it to Slack, and then deleted it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*u7WJ4f9sgAFPzXmnQZiAKQ.png" /><figcaption>The report in Slack</figcaption></figure><p><strong>Implementation of Additional Features</strong></p><p>It might seem like we are just an intermediary between the user and the Power BI service, and though. This is partly true, but it does have many advantages. First, the user doesn’t need to investigate and familiarize themselves with the interface of a new program. Instead, the user can works in a modal view of a familiar messenger. Secondly, the messenger allowed us to implement many additional features, which we will touch upon soon.</p><p><strong>Receiving Reports Directly in Slack</strong></p><p>Receiving reports isn’t an optional feature. We just redirect the report from the browser to Slack. However, you can choose which channel to receive the report from. Thus, it will be visible to all team members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oVif0W4jbq4z2mtsPSpF2Q.png" /><figcaption>Share a report view</figcaption></figure><p>Here you can immediately notice an option “Apply a filter” that has not been discussed yet.</p><p><strong>Filters</strong></p><p>Power BI Filters is a fairly complex system that requires minimal knowledge of SQL and an accurate understanding of the report’s structure. This is how the filter is applied in the web version of the application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*GKq7YR5aXY1ryqSo0uoNfg.png" /><figcaption>Apply a filter in Power BI</figcaption></figure><p>In our application, we’ve implemented a similar functionality with the usual interface elements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GWxbG4EuiRC-1O7pL5JT-w.png" /><figcaption>Apply a filter in an application</figcaption></figure><p>You can also use the Advanced filter with customization options.</p><p>The first advantage of our application is the ability to save the filter for later reuse. If you need a specific option, you don’t need to constantly adjust the parameters. You just need to come up with a name for this filter and save it. In the future, you can always find it in the list of saved filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCkEdOWEqyBc43Wlu26uBQ.png" /><figcaption>Saved filters</figcaption></figure><p>You may have noticed that in order to work with filters, you need to know the table structure and the expected values. While there is no way around this, we tried to simplify it too. It often happens that one person creates reports in Power BI, and the whole team uses them. Then this one person, with complete knowledge of the structure, can create filters with names that are intuitive for other users. They will only have to select the one they need when generating the report. To configure filters we made a separate modal view where you can create, edit, and delete filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*600u6fGQeCDd13reTt60hA.png" /><figcaption>Manage filters</figcaption></figure><p><strong>Schedule a report</strong></p><p>Imagine this situation: your team is working on a project and every day (or once a week/ or once a month) you have a meeting where you discuss current results and make further plans. In this one, you (and possibly all team members) need to log into Power BI every time you want (and possibly all team members) to check the data changes.</p><p>We’ve implemented the creation of scheduled reports for a specific time on any selected day. Now we’ve implemented three types of periodicity — every day, once a week (with the choice of a specific day) and once a month (also with the choice of a specific day of the month). You can choose any time with an accuracy of half an hour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZHI4MTs6ITfevqnUv7LYQ.png" /><figcaption>Schedule a report</figcaption></figure><p>Now it’s enough to create one report and at the right time and on the right day you will receive fresh data.</p><p><strong>Manage Scheduled reports.</strong></p><p>ShouldPerhaps the information sent by the application beis no longer relevant, we made a separate modal view to help users . To manage scheduled reports we made a separate modal view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KPWAVkTmGTQPC4yE0KeJ3g.png" /><figcaption>Manage scheduled reports</figcaption></figure><p>Here you have the option to pause the sending of a report, resume paused reports, or delete reports that are no longer used.</p><p><strong>Create an Alert</strong></p><p>Another feature of our application is the ability to create alerts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkmLiYagVN0Jm82PlPsT1Q.png" /><figcaption>Create an alert</figcaption></figure><p>You can customize specific conditions and thresholds for any data. Then if this value is above / below / equal to the threshold value, the application will send a message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*iBOQAJY1DBrMeaVlVCcHIQ.png" /><figcaption>Alert</figcaption></figure><p>You can also configure the frequency of receiving the notification — once an hour or once a day.</p><p>This feature allows you to get away from monitoring data in Power BI, and contact the service only if some value has reached the set level.</p><p><strong>Manage alerts</strong></p><p>Similar to scheduled reports, we have implemented the ability to stop, resume, or delete alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*QFVQmGVfFMO9Xgks9nG-Sw.png" /><figcaption>Manage alerts</figcaption></figure><p>All of the above capabilities create a powerful tool for working with Microsoft Power BI directly from Slack.</p><p><strong>Service architecture and deployment</strong></p><p>Our application interacts with two services at once — Microsoft Power BI and Slack. Some processes are started directly by the Slack user — generating a report. In this case, we receive a request from Slack, transfer it to the Power BI service and send screenshot back to Slack. But there are also processes that are launched on our server independently — for example, the generation of each scheduled report. The problem is also that scheduled reports are generated at a specific time, which means that many users may choose the same value. In this case, performance decreases and the time for the report generation increases.</p><p>To solve this problem, we divided our application into several microservices — api for interactions with with Slack users, one for tasks scheduler and one for reports generation. We have completely separated the processes of working with the API of our application and the process of creating reports in Power BI (launching the browser, taking a screenshot, saving, etc.).</p><p>It also allowed us to have a better control on the load and setup the automatic scaling for our servers. If the load on the reports engine increases, additional servers automatically allocated to improve performance and handle all the requests in time . If they are no longer needed, they are shut down and the cluster returns back to single instance to help us save money and reduce datacenter usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*Y71HICgRhJkvENyDAdqLCQ.png" /><figcaption>Overall design</figcaption></figure><p><strong>Conclusion</strong></p><p>To help Slack users have a better experience with Microsoft’s Power BI, we tried to make a convenient, simple and pleasant Slack application that makes it easier for users to interact with Power BI. We hope you are interested in it and you will try to use it in your projects. The application is currently free and available for download in the Slack application section. We are discussing further development and will be glad to receive feedback and suggestions.</p><p><strong>Links</strong></p><p><a href="https://manage-bi.com/">https://manage-bi.com/</a> — application</p><p><a href="https://slackpowerbistaging.slack.com/apps/A01BRN53YM8-power-bi-integration-by-akvelon">https://slackpowerbistaging.slack.com/apps/A01BRN53YM8-power-bi-integration-by-akvelon</a> — slack directory</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1850ef108d53" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>