By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Apple Improves Context Window Management for its Foundation Models
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > News > Apple Improves Context Window Management for its Foundation Models
News

Apple Improves Context Window Management for its Foundation Models

News Room
Last updated: 2026/03/23 at 7:40 AM
News Room Published 23 March 2026
Share
Apple Improves Context Window Management for its Foundation Models
SHARE

iOS 26.4, now in Release Candidate, introduces improved context window management for Apple’s Foundation Models, helping developers work with the 4096-token context window limit. This encourages treating the context window as a constrained resource, which requires actively managing it like memory in a low-resource system to optimize its usage.

As with most large language models, the context window is a critical resource used to hold system instructions, user prompts, and model responses. Because Apple’s Foundation Models run on-device, they offer a relatively small context window which can fill up quickly, especially in chat-like sessions where user prompts and LLM’s responses continuously accumulate.

In such cases, the framework throws an .exceededContextWindowSize error, and the LLM won’t be able to respond within the same session. To recover from this error, developers need to start a new session and reinitialize its state so it can effectively carry on with the existing workflow without impairing user experience.

In a previous technical note, Apple outlined practical strategies for developers to proactively deal with the context window limitation, such as splitting large tasks into multiple LLM sessions, asking the model to generate shorter answers, trimming prompts by summarizing them or retaining only the most relevant turns, and using tool calling efficiently.

To help developers track how the context window is being used, iOS 26.4 introduced a new contextSize property on SystemLanguageModel, which returns the available context capacity, along with a tokenCount(for:) method to measure how many token a given input consumes. While the current maximum is 4096 tokens, contextSize removes the need to hardcode that limit and tokenCount(for:) is the foundation for token bookkeeping, allowing apps to adapt dynamically.

Knowing the context window size and being able to calculate token consumption are essential, but they don’t solve all the problems for developers, since managing token consumption is not a trivial task. In a practical article, Artem Novichkov demonstrates an effective approach.

Artem points out that you must account for all components contributing to the context, including the system prompt and user instructions, but also how tool usage affects the context window size, which can be surprising:

When you use tools, their definitions (name, description, and argument schema) are serialized and sent alongside your instructions. This increases the token count significantly.

Note that Artem refers to the tokenUsage(for:) method in its article, which appears to have been renamed to tokenCount(for:) in the latest RC release. He also highlights that these new additions to the Foundation Models framework are marked with [@backDeployed](https://www.hackingwithswift.com/swift/5.8/function-back-deployment)(before: iOS 26.4, macOS 26.4, visionOS 26.4), making them available on all iOS versions that support the framework.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article AMD Posts Latest “pghot” Code For Overhauling Linux Hot Page Tracking & Promotion AMD Posts Latest “pghot” Code For Overhauling Linux Hot Page Tracking & Promotion
Next Article Microsoft Warns IRS Phishing Hits 29,000 Users, Deploys RMM Malware Microsoft Warns IRS Phishing Hits 29,000 Users, Deploys RMM Malware
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

One notable TV brand is dropping Google TV altogether
One notable TV brand is dropping Google TV altogether
News
CcHUB launches GATEWAY to train 340,000 Nigerians for global gig work 
CcHUB launches GATEWAY to train 340,000 Nigerians for global gig work 
Computing
Inside Netflix’s Graph Abstraction: Handling 650TB of Graph Data in Milliseconds Globally
Inside Netflix’s Graph Abstraction: Handling 650TB of Graph Data in Milliseconds Globally
News
7 Steps to Turn One Amazon Video into Two Streams of Affiliate Income – Digital Marketing
Computing

You Might also Like

One notable TV brand is dropping Google TV altogether
News

One notable TV brand is dropping Google TV altogether

4 Min Read
Inside Netflix’s Graph Abstraction: Handling 650TB of Graph Data in Milliseconds Globally
News

Inside Netflix’s Graph Abstraction: Handling 650TB of Graph Data in Milliseconds Globally

4 Min Read
Instagram encryption U-turn leaves us all more vulnerable – 9to5Mac
News

Instagram encryption U-turn leaves us all more vulnerable – 9to5Mac

3 Min Read
Psst. Our Readers Are Looking at These Gadgets Before Amazon's Big Spring Sale Even Starts
News

Psst. Our Readers Are Looking at These Gadgets Before Amazon's Big Spring Sale Even Starts

10 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?