# Choosing a foundation model in watsonx\.ai #

To determine which models might work well for your project, consider model attributes, such as license, pretraining data, model size, and how the model was fine\-tuned\. After you have a short list of models that best fit your use case, systematically test the models to see which ones consistently return the results you want\.

<!-- <table> -->

Table 1\. Considerations for choosing a foundation model in IBM watsonx\.ai

| Model attribute                 | Considerations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Context length                  | Sometimes called *context window length*, *context window*, or *maximum sequence length*, context length is the maximum allowed value for the number of tokens in the input prompt plus the number of tokens in the generated output\. When you generate output with models in watsonx\.ai, the number of tokens in the generated output is limited by the Max tokens parameter\. For some models, the token length of model output for Lite plans is limited by a dynamic, model\-specific, environment\-driven upper limit\.                                                                                                                                                                                                                                                    |
| Cost                            | The cost of using foundation models is measured in resource units\. The price of a resource unit is based on the rate of the billing class for the foundation model\.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Fine\-tuning                    | After being pretrained, many foundation models are fine\-tuned for specific tasks, such as classification, information extraction, summarization, responding to instructions, answering questions, or participating in a back\-and\-forth dialog chat\. A model that was fine\-tuned on tasks similar to your planned use typically perform better with zero\-shot prompts than models that were not fine\-tuned in a way that fits your use case\. One way to improve results for a fine\-tuned model is to structure your prompt in the same format as prompts in the data sets that were used to fine\-tune that model\.                                                                                                                                                       |
| Instruction\-tuned              | *Instruction\-tuned* means that the model was fine\-tuned with prompts that include an instruction\. When a model is instruction\-tuned, it typically responds well to prompts that have an instruction even if those prompts don't have examples\.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| IP indemnity                    | In addition to license terms, review the intellectual property indemnification policy for the model\. Some foundation model providers require you to exempt them from liability for any IP infringement that might result from the use of their AI models\. For information about contractual protections related to IBM watsonx\.ai, see the [IBM watsonx\.ai service description](https://www.ibm.com/support/customer/csol/terms/?id=i126-7747)\.                                                                                                                                                                                                                                                                                                                                                        |
| License                         | In general, each foundation model comes with a different license that limits how the model can be used\. Review model licenses to make sure that you can use a model for your planned solution\.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Model architecture              | The architecture of the model influences how the model behaves\. A transformer\-based model typically has one of the following architectures:  <br>• *Encoder\-only*: Understands input text at the sentence level by transforming input sequences into representational vectors called embeddings\. Common tasks for encoder\-only models include classification and entity extraction\.  <br>• *Decoder\-only*: Generates output text word\-by\-word by inference from the input sequence\. Common tasks for decoder\-only models include generating text and answering questions\.  <br>• *Encoder\-decoder*: Both understands input text and generates output text based on the input text\. Common tasks for encoder\-decoder models include translation and summarization\. |
| Regional availability           | You can work with models that are available in the same IBM Cloud regional data center as your watsonx services\.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Supported natural languages     | Many foundation models work well in English only\. But some model creators include multiple languages in the pretraining data sets to fine\-tune their model on tasks in different languages, and to test their model's performance in multiple languages\. If you plan to build a solution for a global audience or a solution that does translation tasks, look for models that were created with multilingual support in mind\.                                                                                                                                                                                                                                                                                                                                                |
| Supported programming languages | Not all foundation models work well for programming use cases\. If you are planning to create a solution that summarizes, converts, generates, or otherwise processes code, review which programming languages were included in a model's pretraining data sets and fine\-tuning activities to determine whether that model is a fit for your use case\.                                                                                                                                                                                                                                                                                                                                                                                                                          |

<!-- </table ""> -->

## Learn more ##

<!-- <ul> -->

 *  [Tokens and tokenization](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-tokens.html)
 *  [Model parameters for prompting](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-model-parameters.html)
 *  [Prompt tips](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-prompt-tips.html)
 *  [Watson Machine Learning plans](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/wml-plans.html)
 *  [Regional availability for foundation models](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/regional-datactr.html#data-centers)

<!-- </ul> -->

**Parent topic:**[Supported foundation models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html)

<!-- </article "role="article" "> -->