{"id":12841,"date":"2025-02-10T14:53:26","date_gmt":"2025-02-10T22:53:26","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?page_id=12841"},"modified":"2025-06-12T17:53:15","modified_gmt":"2025-06-12T17:53:15","slug":"mandar-kulkarni","status":"publish","type":"page","link":"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/","title":{"rendered":"Mandar Kulkarni"},"content":{"rendered":"\n<div class=\"wp-block-cover alignfull has-parallax\" style=\"margin-bottom:var(--wp--preset--spacing--100);padding-top:var(--wp--preset--spacing--160);padding-bottom:var(--wp--preset--spacing--100)\"><div class=\"wp-block-cover__image-background wp-image-16488 has-parallax\" style=\"background-position:50% 50%;background-image:url(https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/02\/convergence-hero-background-scaled.jpg)\"><\/div><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim-0 has-background-dim\" style=\"background-color:#4a1e26\"><\/span><div class=\"wp-block-cover__inner-container is-layout-constrained wp-block-cover-is-layout-constrained\">\n<div class=\"wp-block-group alignwide is-content-justification-left is-layout-constrained wp-container-core-group-is-layout-12dd3699 wp-block-group-is-layout-constrained\">\n<p class=\"has-background-color has-text-color has-link-color wp-elements-5a2024186819c231e941dc556eed5a54\"><a href=\"https:\/\/www.comet.com\/site\/convergence\/\">\u2190 BACK TO EVENT PAGE<\/a><\/p>\n\n\n\n<div class=\"wp-block-columns alignwide is-layout-flex wp-container-core-columns-is-layout-b61b2f12 wp-block-columns-is-layout-flex\" style=\"margin-top:var(--wp--preset--spacing--50)\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:275px\">\n<figure class=\"wp-block-image size-large is-resized is-style-opik is-style-opik--1\"><img loading=\"lazy\" decoding=\"async\" width=\"539\" height=\"539\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2024\/04\/Mandar-Kulkarni.jpeg\" alt=\"Mandar Kulkarni headshot\" class=\"wp-image-9761\" style=\"aspect-ratio:1;object-fit:cover;width:275px\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2024\/04\/Mandar-Kulkarni.jpeg 539w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2024\/04\/Mandar-Kulkarni-300x300.jpeg 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2024\/04\/Mandar-Kulkarni-150x150.jpeg 150w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-group is-content-justification-left is-layout-constrained wp-container-core-group-is-layout-a0d49d46 wp-block-group-is-layout-constrained\"><h1 style=\"font-style:normal;font-weight:400;\" class=\"wp-block-post-title has-display-m-font-size\">Mandar Kulkarni<\/h1>\n\n\n<h2 class=\"wp-block-heading has-body-l-font-size\" id=\"h-data-science-educator-and-vanishing-gradients-host\" style=\"font-style:normal;font-weight:400\">Senior Data Scientist at Flipkart<\/h2>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-opik is-style-opik--2\"\/>\n<\/div>\n\n\n\n<p>Mandar is an experienced researcher with a demonstrated history of working in the research industry. He is skilled in Python, Sequence modelling, Deep Learning, Computer Vision, NLP. He\u2019s a research professional with a Master of Science (MS) focused in Computer vision from Indian Institute of Technology, Madras.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n<p class=\"has-text-align-center has-custom-opik-red-color has-text-color has-link-color wp-elements-6a0f093506b739352a934c628ca14f2e\">May 8, 2024<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\" id=\"h-evaluation-driven-development-building-reliable-ai-systems\" style=\"margin-top:var(--wp--preset--spacing--8)\">Cost Optimizing RAG for Large Scale E-Commerce Conversational Assistants<\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-opik is-style-opik--3\" style=\"margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)\"\/>\n\n\n\n<p class=\"has-text-align-center\">With the advent of Large Language Models (LLM), conversational assistants have become prevalent in E-commerce use cases. Trained on a large web-scale text corpus with approaches such as instruction tuning and Reinforcement Learning with Human Feedback (RLHF), LLMs have become good at contextual question-answering tasks, i.e. given a relevant text as a context, LLMs can generate answers to questions using that information. Retrieval Augmented Generation (RAG) is one of the key techniques used to build conversational assistants for answering questions on domain data. RAG consists of two components: a retrieval model and an answer generation model based on LLM. The retrieval model fetches context relevant to the user\u2019s query. The query and the retrieved context are then inputted to the LLM with the appropriate prompt to generate the answer. For API-based LLMs (e.g., ChatGPT), the cost per call is calculated based on the number of input and output tokens. A large number of tokens passed in a context leads to a higher cost per API call. With a high volume of user queries in e-commerce applications, the cost can become significant. In this work, we first develop a RAG-based approach for building a conversational assistant that answers user\u2019s queries about domain-specific data. We train an in-house retrieval model using info Noise Contrastive Estimation (infoNCE) loss. Experimental results show that the in-house model outperforms public pre-trained embedding models w.r.t. retrieval accuracy and Out-of-Domain (OOD) query detection. For every user query, we retrieve top-k documents as context and input them to the ChatGPT to generate the answer. We maintain the previous conversation history to enable the multi-turn conversation. Next, we propose an RL-based approach to optimize the number of tokens passed to ChatGPT. We noticed that for certain patterns\/sequences of queries, we can get a good answer from RAG even without fetching the context e.g. for a follow-up query, a context need not be retrieved if it has already been fetched for the previous query. Using this insight, we propose a policy gradient-based approach to optimize the number of LLM tokens and cost. The RL policy model can take two actions, fetching a context or skipping retrieval. A query and policy action-based context are inputted to the ChatGPT to generate the answer. A GPT-4 LLM is then used to rate these answers. Rewards based on the ratings are used to train the policy model for token optimization. Experimental results demonstrated that the policy model provides significant token saving by dynamically fetching the context only when it is required. The policy model resides external to RAG and the proposed approach can be experimented with any existing RAG pipeline. For more details, please refer to our AAAI 2024 workshop paper: https:\/\/arxiv.org\/abs\/2401.06801<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-d234f690 wp-block-buttons-is-layout-flex\" style=\"margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50)\">\n<div class=\"wp-block-button is-style-opik is-style-opik--4\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.comet.com\/site\/events\/convergence\/#register\">Register now<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":12738,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"convergence","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"coauthors":[126],"class_list":["post-12841","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Mandar Kulkarni - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mandar Kulkarni\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-12T17:53:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/10\/Share-image-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"945\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data2\" content=\"engineering@atre.net\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Mandar Kulkarni - Comet","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/","og_locale":"en_US","og_type":"article","og_title":"Mandar Kulkarni","og_url":"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_modified_time":"2025-06-12T17:53:15+00:00","og_image":[{"width":1800,"height":945,"url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/10\/Share-image-3.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@Cometml","twitter_misc":{"Est. reading time":"3 minutes","Written by":"engineering@atre.net"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/","url":"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/","name":"Mandar Kulkarni - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"datePublished":"2025-02-10T22:53:26+00:00","dateModified":"2025-06-12T17:53:15+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/convergence\/mandar-kulkarni\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Convergence 2025","item":"https:\/\/www.comet.com\/site\/convergence\/"},{"@type":"ListItem","position":3,"name":"Mandar Kulkarni"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/pages\/12841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=12841"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/pages\/12841\/revisions"}],"predecessor-version":[{"id":16652,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/pages\/12841\/revisions\/16652"}],"up":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/pages\/12738"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=12841"}],"wp:term":[{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=12841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}