State

Asked on 09/08/2024

1 search

The concept of "state" in machine learning models, as discussed in the WWDC sessions, refers to the ability of a model to retain information across different runs or inferences. This is particularly useful for models that need to maintain a history or context, such as language models that generate text based on previous inputs.

In the session Bring your machine learning and AI models to Apple silicon, it was highlighted that Core ML now supports stateful models, which automatically manage state tensors without needing to define them as inputs or outputs. This leads to better performance, as the model can update states in place.

Similarly, in the session Deploy machine learning and AI models on-device with Core ML, the use of state in models is explored to improve efficiency, particularly in language models. By using a key-value cache (KV cache) managed by Core ML states, the overhead is reduced, leading to faster prediction times.

These advancements in handling state within machine learning models on Apple silicon are designed to enhance performance and simplify the development process.