Intelligent formulas is a beta feature that assists users in creating formulas in Keelvar using natural language descriptions called "prompts".

This feature is available on the following pages in Sourcing Optimizer:

- Primary and Secondary Cost Calculations
- Conditional validation rules
- Feedback Columns
- Formula Columns

## Create an Intelligent formula

- Navigate to
**Cost Calculation**on the**Design**menu - On the
**Primary**tab, enter a cost calculation prompt in the**Intelligent formulas**text box - Select
**Generate formula** - A suggested formula is returned, which can be accepted by clicking
**Use this formula**which then adds and validates the formula in the cost calculation field -
*Optional:*Select**Explain formula**to explain what the current formula means with a step-by-step explanation of the calculation, as well as a hypothesis of what the goal and function of the formula might be

Intelligent formulas uses AI based on Large Language Models (LLMs). Like any output from advanced LLMs, formulas can contain mistakes. Users must review and approve all formulas to ensure accuracy before using them.

Keelvar follows best practice in AI based processing. This feature can be enabled or disabled based on your organization preference. Contact your Customer Success Manager for additional information or to enable the feature.

## Usage tips

- Always check the formula for errors and omissions. Intelligent formulas are created by GenAI (a Large Language Model) and as such may contain mistakes or misinterpretations of the user's intent.
- Reduce the likelihood of a misinterpretation by making a detailed and unambiguous request. For example, expand any acronyms in the prompt that do not also appear in the bid sheet column names.
- Imagine prompts as instructions for a novice assistant: a little more context or precision added to the request can increase the chances of getting the desired outcome. If a concept is subtle, or the LLM is struggling, add more to the prompt. For example, adding the words "sum of" in the following prompt fixed a misinterpretation: "Give me price as the
*sum of*volume times cost for each weight bracket. Make sure you do it for all weight brackets in the list of columns." - With the exception of Feedback functions, note that the functions in formulas operate on a single bid only and do not aggregate data nor make comparisons across bids. Think of the functions as accessing column contents "horizontally" within a bid sheet row. The exception is that Feedback functions (xRANK, xRANKVALUE, xRANKBIDDER, xCOUNT, xAVERAGE, xMEDIAN), as are available for use in Feedback Formulas, are used to make comparisons over bids. By contrast, these can operate "vertically" on columns over different bids on the bid sheet.
- While generating formulas, the LLM has access to limited information about the specific event and bid sheet. Specifically, it knows about the current request text and the names of the mandatory bid sheet columns. It does not know the following: which columns are bidder input; the specific contents of bid sheet columns (e.g. the names of places in a Destination column); the formulas for any other formula columns; any past requests, past formulas or formulas displayed on the same page.
- Formulas carry out specific calculations or transformations on the data in the bid sheet. It is beyond the scope of Intelligent Formulas to suggest formulas that produce analysis regarding business outcomes such as which bidders to award or the savings accomplished under different business rules. Use Keelvar Scenarios to carry out such analysis.

## Trouble Shooting

- To improve performance, avoid using quotation marks in column names and queries, as they can cause issues. If quotation marks appear where they should not be in a formula, modify the prompt to instruct that they should not be used.
- Formulas longer than 8000 characters will fail after a delay - this is a limitation of the current Large Language Model. This issue may arise if a large number of columns must be referenced one or more times in the formula. Consider an alternative approach and prompt. It is not always possible to know before generation exactly how long a formula may be.
- Long formulas are slow to generate, taking up to 30 seconds or more. The longer the formula, the more time it requires.
- Sometimes the LLM suggests Excel functions that aren't available in Keelvar, like NOT() or LET(). To correct this if it arises, include a note in your prompt to avoid these functions, and the LLM will usually find a suitable alternative. For example, "Check that handling fees are not blank. Avoid using the NOT() function."
- If the Intelligent formula gives incomplete output, such as using "... and so on..." in a formula, adjust your prompt to request the full formula to be written out completely. This ensures you get a complete and usable result.

The generative AI (Large Language Model) enabling Intelligent Formulas is privately hosted by our cloud service provider and is secure. Data submitted is not used for model training and is not available to other users.