- Expert view
- Industry trends
Ask and You Shall Receive: How to Talk to Data and Get Smart Insights
Learn how to leverage the power of natural language processing to query and summarize structured data with ease and efficiency – avoiding hallucinations.
By Thomas Burke, Director of Software Engineering, UI Platform and Alex Brooker, VP R&D at Cirium
In a world where data is often referred to as the new oil, the ways we access and analyze it are evolving at an extraordinary pace. Undoubtedly, one of the most exciting advancements in this space is the entry of large language models (LLMs) into the mainstream. Developers across all industries now have access to APIs that allow them to unlock the incredible capabilities of LLMs.
Among the many promising applications of these technologies is the ability to bring natural language-driven data access into reality. Data practitioners are always on the lookout for efficiencies in extracting information from their data, and LLMs provide compelling new capabilities to achieve this.
As powerful as LLMs are, it’s important to note that they cannot inherently understand your data, but when properly leveraged they can help you query and summarize data. They need some guidance, though, often provided in the form of metadata to aid in accurately converting a natural language prompt into a data query.
One common method is Text-to-SQL. Leveraging the power of a general-purpose LLM, it involves providing the user’s question, a “system prompt” outlining the specifics of SQL behavior, and detailed metadata about your database schema to the LLM. The result? A SQL query that you can validate, sanitize, and execute against your database.
“What is the current location of flight AA 100?”
Another prevalent strategy is known as Function Calling. This technique employs a language model to generate parameters that can be used to call a function. For instance, to answer the questions “What is the current location of flight AA 100?” “What is the chance my flight could be delayed?”, Function Calling could generate necessary parameters to call the Cirium Sky API, summarize the returned data as natural language, and relay the output to the user without hallucinations.
The choice between Text-to-SQL or Function Calling depends on the task at hand. While Text-to-SQL is arguably more expressive and can deliver complex insights, Function Calling might be preferable for reasons of reliability and security, dependent on the implementation.
A Semantic Layer aids in flexible modeling and describing data in a way that’s programmatically accessible.
Regardless of the technique you opt for, providing access to metadata is crucial. A common and effective solution for this is implementing a Semantic Layer. A Semantic Layer aids in flexible modeling and describing data in a way that’s programmatically accessible. This can help provide a scalable solution to ensuring appropriate metadata is provided to the language model.
In summary, the integration of natural language-driven data access and analysis augments the capabilities of data professionals, automates complex tasks and promotes efficiency in dealing with substantial data sets. LLMs are only part of the system behind any product, and both Text-to-SQL and function calling are now part of the stack.
As LLMs continue to evolve, we can expect even more exciting developments in this field. Stay tuned to this space for more updates and reach out to engage with our R&D team.
Interested in the latest Generative AI technology?
Contact the team to receive the latest updates or register your interest to work with our labs team. Learn more about Cirium Sky API.