Function changes, new releases, and more that preview users need to check out
If you, like DAS42, got in and got your fingerprints all over Snowflake’s Cortex AI functions the minute they were available, there are a handful of important updates you might have missed! Here’s a roundup of what you need to know to keep your early Cortex functions from crashing and kick the wheels on new functionality.
What is Snowflake Cortex?
Snowflake Cortex is the name for Snowflake’s managed AI functions. We’re going to focus here on the large language model (LLM) functionality:
- COMPLETE: Given an input / prompt and a specified LLM, the COMPLETE function returns a response from that LLM.
- EMBED_TEXT_768: Provides vector embedding for a piece of text, enabling vector similarity functions between two vectors. See “Breaking Changes” section below.
- EXTRACT_ANSWER: Given a question and a set of unstructured data, returns an answer if it can find one in that data.
- SENTIMENT: Given text, provides a sentiment score from -1 (negative sentiment) to 1 (positive sentiment).
- SUMMARIZE: Does what it says! Given text, provides a summary.
- TRANSLATE: It translates content from one supported language to another. Not to be confused with the non-Cortex “translate()” function.
Use Cases
With the preview feature of the vector datatype, we can use EMBED_TEXT_768 and either COMPLETE or EXTRACT_ANSWER to power retrieval-augmented generation – for example, in a chatbot application.
COMPLETE also helps us use LLMs to assess data quality on specific fields or to perform more nuanced sentiment assessments – not just on a negative–to-positive scale, but identifying specific sentiments, e.g. “Does this content provoke fear?”
Of course, the use of SENTIMENT, SUMMARIZE, and TRANSLATE functions are fairly self–explanatory.
Availability
Snowflake Cortex is generally available (in Azure and AWS, with varying availability of models in each region). The vector datatype is still in private preview in some regions, but coming soon to GA in some regions/clouds and public preview in others.
Breaking Changes
Two changes have been made; these functions need to be updated in your code. Inputs and outputs are the same.
- The previously named EMBED_TEXT function has been renamed EMBED_TEXT_768.
- The previously named VECTOR_COSINE_DISTANCE function has been renamed VECTOR_COSINE_SIMILARITY.
Available Models
The number of large language models available has doubled from five to ten, with one of the new releases being Snowflake’s own LLM, Snowflake Arctic, designed for “enterprise tasks such as SQL generation, coding, and instruction following benchmarks.”. Not all models are available on all clouds / in all regions, so check out the documentation for more – but other examples of more recent rollouts include “reka-flash,” “reka-core,” and a greater variety of Llama models.
Documentation
The documentation pages (like this one and this one) have been updated with lots more helpful info and context. (Also, some typos in the model names were fixed, so you know the right values to input in the function call).
We’re so excited about Snowflake Summit 2024, where we can learn more about what’s coming next and see how others are using Cortex. Come find us at Snowflake Summit at the “demo village,” booth #2324, or reach out below.
DAS42 is a premier data and analytics consultancy with a modern point of view. We specialize in solving some of the most complex business challenges for the world’s most successful companies. As a Snowflake Elite Partner, DAS42 crafts customized strategies that create a single source of truth and enable enhanced and faster decision-making. DAS42 has a presence across the U.S. with primary offices in New York City and Denver. Connect with us at das42.com and stay updated on LinkedIn. Join us today on our journey to help you realize the possibilities of transforming your business through data and analytics.