Generative AI Crash Course for Non-Tech Professionals. Register Now >

Breaking Boundaries: The Chatbot Transforming Retail Media Campaigns

NSQL 350M chatbot revolutionizes retail analytics, simplifying data-driven decisions for media campaigns at MLDS 2024.

In the bustling halls of the Machine Learning Developers Summit (MLDS) 2024 in Bengaluru, Suvojit Hore, a Senior Applied Data Scientist at Dunnhumby, took center stage to share groundbreaking insights into the transformation of retail media campaigns. With a focus on leveraging the capabilities of large language models, Hore introduced a chatbot interface powered by NSQL 350M, aiming to bridge the gap between natural language queries and SQL commands.

Challenges in Retail Media Analysis

Suvojit began his talk by addressing the challenges faced by retailers in analyzing vast amounts of campaign transaction and product transaction data. Traditional methods, such as email conversations and rule-based chatbots, proved time-consuming, limited in options, and often struggled with complex queries. Recognizing the need for an innovative solution, the data science team at Dunnhumby embarked on a journey to revolutionize retail media analysis.

Introducing NSQL 350M-Powered Chatbot

The heart of Suvojit’s presentation was the introduction of NSQL 350M, a 350-million-parameter open-source language model. This model serves as the backbone for the chatbot, translating natural language queries into SQL commands. The chatbot allows business users, particularly non-technical media planners, to interact with the database in English, posing questions about historical campaign data effortlessly.

Selecting the Right Model: A Journey of Experimentation

Hore detailed the process of selecting the appropriate model for their solution. Experimenting with various open-source models available on Hugging Face, the team considered factors such as accuracy, model size, and feasibility for their specific use case. While larger models like NSQL U 6 billion and EscaL Coder 34 billion exhibited higher accuracy, the team settled on the 350 million parameter version of NSQL for its balance between speed, accuracy, and size.

Overcoming Challenges with Prompt Engineering

The talk delved into the critical role of prompt engineering in enhancing the accuracy of the chatbot. Hore emphasized the need for a structured prompt, including column names, instructions, schema, and user queries. Specific instructions were integrated into the prompts to combat hallucination, a common challenge in large language models. The team also addressed spelling errors and synonym issues in user queries by maintaining a synonym dictionary, ensuring precise language model outputs.

Fine-Tuning for Business-specific Accuracy

The team engaged in fine-tuning to tailor the chatbot to Dunnhumby’s business requirements. Using a set of instructions and SQL query pairs based on campaign data, the model underwent parameter-efficient fine-tuning, resulting in an impressive accuracy improvement from 55% to 80%. Hore highlighted the importance of fine-tuning on specific business data to ensure optimal performance.

User Interface and Future Enhancements

Concluding the technical details, Hore showcased the user interface created with Streamlit, providing media planners with an easy-to-use platform. He outlined ongoing efforts to continuously improve the model, including plans to expand the chatbot’s capabilities to generate charts, plots, and additional insights. The team is exploring the scalability of the Escal Coder 34 billion model on a GPU and considering human feedback for reinforcement learning and direct policy optimization.

Looking Ahead

Suvojit Hore’s talk at MLDS 2024 unveiled a transformative approach to retail media analysis, emphasizing the power of large language models in simplifying complex queries. The NSQL 350M-powered chatbot holds the potential to reshape how business users interact with and extract insights from vast datasets, marking a significant leap forward in the realm of retail media campaigns. As Dunnhumby continues to refine and expand the capabilities of their chatbot, the future promises even more efficient and accessible data-driven decision-making in the retail sector.

Picture of Shreepradha Hegde

Shreepradha Hegde

Shreepradha is an accomplished Associate Lead Consultant at AIM, showcasing expertise in AI and data science, specifically Generative AI. With a wealth of experience, she has consistently demonstrated exceptional skills in leveraging advanced technologies to drive innovation and insightful solutions. Shreepradha's dedication and strategic mindset have made her a valuable asset in the ever-evolving landscape of artificial intelligence and data science.

The Chartered Data Scientist Designation

Achieve the highest distinction in the data science profession.

Elevate Your Team's AI Skills with our Proven Training Programs

Strengthen Critical AI Skills with Trusted Generative AI Training by Association of Data Scientists.

Our Accreditations

Get global recognition for AI skills

Chartered Data Scientist (CDS™)

The highest distinction in the data science profession. Not just earn a charter, but use it as a designation.

Certified Data Scientist - Associate Level

Global recognition of data science skills at the beginner level.

Certified Generative AI Engineer

An upskilling-linked certification initiative designed to recognize talent in generative AI and large language models

Join thousands of members and receive all benefits.

Become Our Member

We offer both Individual & Institutional Membership.