Best practices for foundation model context window
Asked on 2025-07-05
1 search
For best practices regarding the context window of foundation models, you can refer to the session titled "Explore prompt design & safety for on-device foundation models" from WWDC 2025. This session covers various aspects of prompt engineering, including how to control the amount of content generated by the model and how to specify the style and voice of the text. It also discusses the importance of designing prompts that are safe and appropriate for your app's use case.
For more detailed information, you can check out the chapter on "Prompting best practices" in the session Explore prompt design & safety for on-device foundation models (06:14). This section provides insights into how to effectively design prompts for on-device foundation models.

Explore prompt design & safety for on-device foundation models
Design generative AI experiences that leverage the strengths of the Foundation Models framework. We’ll start by showing how to design prompts for the on-device large language model at the core of Apple Intelligence. Then, we’ll introduce key ideas around AI safety, and offer concrete strategies to make your generative AI features safe, reliable, and delightful.

Discover machine learning & AI frameworks on Apple platforms
Tour the latest updates to machine learning and AI frameworks available on Apple platforms. Whether you are an app developer ready to tap into Apple Intelligence, an ML engineer optimizing models for on-device deployment, or an AI enthusiast exploring the frontier of what is possible, we’ll offer guidance to help select the right tools for your needs.

Meet the Foundation Models framework
Learn how to tap into the on-device large language model behind Apple Intelligence! This high-level overview covers everything from guided generation for generating Swift data structures and streaming for responsive experiences, to tool calling for integrating data sources and sessions for context management. This session has no prerequisites.