Home Technology peripherals AI Revealed! A 47-page document dismantling Apple's intelligence, from architecture and data to training and optimization

Revealed! A 47-page document dismantling Apple's intelligence, from architecture and data to training and optimization

Aug 01, 2024 am 03:26 AM
industry

At the 2024 Worldwide Developers Conference, Apple launched Apple Intelligence, a new personalized intelligent system that can provide practical intelligent services, covering iPhone, iPad and Mac, and is deeply integrated in iOS 18, In iPadOS 18 and macOS Sequoia.

Cook once said that Apple Intelligence is a new chapter in Apple’s innovation and will change the way users use products. He emphasized that Apple's unique approach combines generative artificial intelligence and users' personal information to provide truly useful intelligent services. Additionally, Apple Intelligence provides completely private and secure access to information, helping users accomplish what matters most to them. This is an AI experience unique to Apple.

Now, more than a month has passed since the official announcement of Apple Intelligence. This technology has finally been implemented on smart devices, and the relevant technical documents have finally been released.

In the past day, users who own iPhone 15 Pro or iPhone 15 Pro Max can download the iOS 18.1 development beta and experience the features of Apple Intelligence.

With the release of this 47-page technical report, we can have a deeper understanding of the secret weapon behind Apple Intelligence.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

  • Report address: https://machinelearning.apple.com/papers/apple_intelligence_foundation_language_models.pdf

The report details two of the models - AFM-on-device, AFM Stands for Apple Foundation Model, a language model with approximately 3 billion parameters, and a larger server-based language model AFM-server that can perform specialized tasks efficiently, accurately, and responsibly (Figure 1).

These two base models exist as part of Apple’s larger family of generative models.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

Architecture and training

AFM basic model is a dense decoder model built on the Transformer architecture, with the following design:

  • Shared input/output embedding matrix to reduce Memory usage for parameters.
  • Use RMSNorm for pre-normalization to improve training stability.
  • Query/key normalization to improve training stability.
  • Grouped Query Attention (GQA) with 8 key-value headers to reduce KV cache memory footprint.
  • SwiGLU activated for increased efficiency.
  • RoPE position embedding, the base frequency (base frequency) is set to 500k to support long context.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

The AFM pre-training process plays a key role in developing high-performance language models to support a range of Apple Intelligence features. The research team focuses on efficiency and data quality to achieve a high-quality end-to-end user experience.

In terms of post-training, the research team found that improving general post-training can improve the performance of all Apple Intelligence features because the model will have a stronger ability to follow instructions, reason, and write.

To ensure that these model functions are consistent with Apple’s commitment to protecting user privacy and Apple’s Responsible AI principles, post-training work includes a series of data collection and generation, instruction adjustment and alignment innovation. The post-training process consists of two stages: supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF). The research team proposed two new post-training algorithms: (1) a rejection sampling fine-tuning algorithm with teacher committee (iTeC), and (2) an RLHF algorithm for reinforcement learning iterations with mirror-descent policy optimization ( mirror descent policy optimization) and leave-one-out advantage estimator (MDLOO), significantly improving model quality.

Apple Intelligence Features

The base model is specially designed for Apple Intelligence, a personal intelligence system that supports iPhone, iPad and Mac.

Apple found that they could improve the performance of small models to state-of-the-art levels by fine-tuning them for specific tasks, and in addition, they developed an architecture based on runtime-swappable adapters , enabling a single base model to be specialized for dozens of such tasks. Figure 2 shows a high-level overview.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

Adapter Architecture

Apple uses LoRA adapters to fine-tune models for specific tasks. For each task, we adjust all linear projection matrices in the AFM self-attention layer and fully connected layers in the point-wise feedforward network. By simply fine-tuning the adapter, the original parameters of the base pre-trained model remain unchanged, allowing general knowledge of the model to be preserved while tailoring the adapter to support specific tasks.

Quantization

To incorporate AFM into edge devices with limited memory budgets and reduce inference costs, quantization techniques need to be considered. Previous research has found that 4-bit quantized models suffer small losses compared to raw 32/16-bit floating point.

To achieve the best balance between model capacity and inference performance, Apple developed state-of-the-art quantization methods and a framework that leverages accuracy-recovery adapters. This allows the model to achieve nearly lossless quantization when the average weight of each weight is less than 4 bits, and provides flexible quantization scheme selection.

Method

After post-training, the model is compressed and quantized to obtain an average weight of less than 4 bits. Quantitative models typically exhibit moderate quality loss. Therefore, Apple will not use the quantized model directly for feature development, but attach a set of parameter-efficient LoRA adapters for quality recovery.

It is worth noting that the training accuracy-recovery adapter is sample efficient and can be thought of as a mini version of the training base model. In the pre-training phase of the adapter, only about 10 billion tokens (about 0.15% of the base model training) are needed to fully restore the capabilities of the quantized model.

Since the application adapters will be fine-tuned from these accuracy-recovery adapters, they will not incur any additional memory usage or inference cost. Regarding adapter size, Apple has found that an adapter rank of 16 provides the best trade-off between model capacity and inference performance.

However, for flexibility, Apple provides a set of accuracy-recovery adapters with different ranks {8, 16, 32} for application teams to choose from.

Mixed precision quantization

Residual connections exist for every transformer block and every layer in AFM. Therefore, it is unlikely that all layers are of equal importance. Following this intuition, Apple further reduced memory usage by pushing certain layers to use 2-bit quantization (the default is 4-bit). On average, AFM-on-device can compress to only about 3.5 bits per weight (bpw) without significant quality loss.

Evaluation

The research team uses common open source evaluation tools and benchmarks to evaluate the AFM pre-trained model. Table 2 shows the results of AFM-on-device and AFM-server on HELM MMLU v1.5.0.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

These benchmarks show that the AFM pre-trained model has strong language and inference capabilities, providing a solid foundation for post-training and feature fine-tuning.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

The comparison results of AFM with open source models (Phi-3, Gemma-1.1, Llama-3, Mistral, DBRX-Instruct) and commercial models (GPT3.5 and GPT-4) are as follows 3 shown. AFM models are preferred by human evaluators compared to other models. In particular, AFM-on-device achieved a 47.7% win rate compared to Phi-3-mini despite a 25% smaller model size, even better than the open source strong baselines Gemma-7B and Mistral-7B.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

To measure the model’s ability to generate responses that follow instructions in prompts, the research team evaluated AFM-on-device and AFM-server on the IFEval benchmark, with the results shown in Figure 4 below:

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

As shown in Figure 5, AFM-server achieves the best overall accuracy, better than Gemini-1.5-Pro-Preview-0514 and GPT-4.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

Apple compared AFM to some of the best models as well as smaller open source models. As shown in Figure 6, AFM-on-device can achieve equivalent or better performance compared to Gemma-7B and Mistral-7B. The performance of AFM-server is significantly better than DBRX-Instruct and GPT3.5, and is comparable to GPT4.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

Figure 7 compares the performance of post-trained AFM on mathematical benchmarks. It was found that AFM-on-device performed significantly better than Mistral-7B and Gemma-7B, even though it was less than half their size.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

The figure below shows human raters evaluating the quality of AFM-on-device adapters, Phi-3-mini, Llama-3-8B and Gemma-7B on the summary task. Figure 8 shows that AFM-on-device-adapter generally outperforms other models.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

Responsible AI

Apple Intelligence is developed and designed with user privacy in mind.

Figure 9 summarizes the violation rates given by human raters on different models, the lower the better. Both AFM-on-device and AFM-server are robust to adversarial prompts, with significantly lower violation rates than open source and commercial models.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

Figure 10 shows that the AFM model is preferred by human raters compared to other models.

Revealed! A 47-page document dismantling Apples intelligence, from architecture and data to training and optimization

The above is the detailed content of Revealed! A 47-page document dismantling Apple's intelligence, from architecture and data to training and optimization. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1671
14
PHP Tutorial
1276
29
C# Tutorial
1256
24
DeepMind robot plays table tennis, and its forehand and backhand slip into the air, completely defeating human beginners DeepMind robot plays table tennis, and its forehand and backhand slip into the air, completely defeating human beginners Aug 09, 2024 pm 04:01 PM

But maybe he can’t defeat the old man in the park? The Paris Olympic Games are in full swing, and table tennis has attracted much attention. At the same time, robots have also made new breakthroughs in playing table tennis. Just now, DeepMind proposed the first learning robot agent that can reach the level of human amateur players in competitive table tennis. Paper address: https://arxiv.org/pdf/2408.03906 How good is the DeepMind robot at playing table tennis? Probably on par with human amateur players: both forehand and backhand: the opponent uses a variety of playing styles, and the robot can also withstand: receiving serves with different spins: However, the intensity of the game does not seem to be as intense as the old man in the park. For robots, table tennis

The first mechanical claw! Yuanluobao appeared at the 2024 World Robot Conference and released the first chess robot that can enter the home The first mechanical claw! Yuanluobao appeared at the 2024 World Robot Conference and released the first chess robot that can enter the home Aug 21, 2024 pm 07:33 PM

On August 21, the 2024 World Robot Conference was grandly held in Beijing. SenseTime's home robot brand "Yuanluobot SenseRobot" has unveiled its entire family of products, and recently released the Yuanluobot AI chess-playing robot - Chess Professional Edition (hereinafter referred to as "Yuanluobot SenseRobot"), becoming the world's first A chess robot for the home. As the third chess-playing robot product of Yuanluobo, the new Guoxiang robot has undergone a large number of special technical upgrades and innovations in AI and engineering machinery. For the first time, it has realized the ability to pick up three-dimensional chess pieces through mechanical claws on a home robot, and perform human-machine Functions such as chess playing, everyone playing chess, notation review, etc.

Claude has become lazy too! Netizen: Learn to give yourself a holiday Claude has become lazy too! Netizen: Learn to give yourself a holiday Sep 02, 2024 pm 01:56 PM

The start of school is about to begin, and it’s not just the students who are about to start the new semester who should take care of themselves, but also the large AI models. Some time ago, Reddit was filled with netizens complaining that Claude was getting lazy. "Its level has dropped a lot, it often pauses, and even the output becomes very short. In the first week of release, it could translate a full 4-page document at once, but now it can't even output half a page!" https:// www.reddit.com/r/ClaudeAI/comments/1by8rw8/something_just_feels_wrong_with_claude_in_the/ in a post titled "Totally disappointed with Claude", full of

At the World Robot Conference, this domestic robot carrying 'the hope of future elderly care' was surrounded At the World Robot Conference, this domestic robot carrying 'the hope of future elderly care' was surrounded Aug 22, 2024 pm 10:35 PM

At the World Robot Conference being held in Beijing, the display of humanoid robots has become the absolute focus of the scene. At the Stardust Intelligent booth, the AI ​​robot assistant S1 performed three major performances of dulcimer, martial arts, and calligraphy in one exhibition area, capable of both literary and martial arts. , attracted a large number of professional audiences and media. The elegant playing on the elastic strings allows the S1 to demonstrate fine operation and absolute control with speed, strength and precision. CCTV News conducted a special report on the imitation learning and intelligent control behind "Calligraphy". Company founder Lai Jie explained that behind the silky movements, the hardware side pursues the best force control and the most human-like body indicators (speed, load) etc.), but on the AI ​​side, the real movement data of people is collected, allowing the robot to become stronger when it encounters a strong situation and learn to evolve quickly. And agile

ACL 2024 Awards Announced: One of the Best Papers on Oracle Deciphering by HuaTech, GloVe Time Test Award ACL 2024 Awards Announced: One of the Best Papers on Oracle Deciphering by HuaTech, GloVe Time Test Award Aug 15, 2024 pm 04:37 PM

At this ACL conference, contributors have gained a lot. The six-day ACL2024 is being held in Bangkok, Thailand. ACL is the top international conference in the field of computational linguistics and natural language processing. It is organized by the International Association for Computational Linguistics and is held annually. ACL has always ranked first in academic influence in the field of NLP, and it is also a CCF-A recommended conference. This year's ACL conference is the 62nd and has received more than 400 cutting-edge works in the field of NLP. Yesterday afternoon, the conference announced the best paper and other awards. This time, there are 7 Best Paper Awards (two unpublished), 1 Best Theme Paper Award, and 35 Outstanding Paper Awards. The conference also awarded 3 Resource Paper Awards (ResourceAward) and Social Impact Award (

Li Feifei's team proposed ReKep to give robots spatial intelligence and integrate GPT-4o Li Feifei's team proposed ReKep to give robots spatial intelligence and integrate GPT-4o Sep 03, 2024 pm 05:18 PM

Deep integration of vision and robot learning. When two robot hands work together smoothly to fold clothes, pour tea, and pack shoes, coupled with the 1X humanoid robot NEO that has been making headlines recently, you may have a feeling: we seem to be entering the age of robots. In fact, these silky movements are the product of advanced robotic technology + exquisite frame design + multi-modal large models. We know that useful robots often require complex and exquisite interactions with the environment, and the environment can be represented as constraints in the spatial and temporal domains. For example, if you want a robot to pour tea, the robot first needs to grasp the handle of the teapot and keep it upright without spilling the tea, then move it smoothly until the mouth of the pot is aligned with the mouth of the cup, and then tilt the teapot at a certain angle. . this

Distributed Artificial Intelligence Conference DAI 2024 Call for Papers: Agent Day, Richard Sutton, the father of reinforcement learning, will attend! Yan Shuicheng, Sergey Levine and DeepMind scientists will give keynote speeches Distributed Artificial Intelligence Conference DAI 2024 Call for Papers: Agent Day, Richard Sutton, the father of reinforcement learning, will attend! Yan Shuicheng, Sergey Levine and DeepMind scientists will give keynote speeches Aug 22, 2024 pm 08:02 PM

Conference Introduction With the rapid development of science and technology, artificial intelligence has become an important force in promoting social progress. In this era, we are fortunate to witness and participate in the innovation and application of Distributed Artificial Intelligence (DAI). Distributed artificial intelligence is an important branch of the field of artificial intelligence, which has attracted more and more attention in recent years. Agents based on large language models (LLM) have suddenly emerged. By combining the powerful language understanding and generation capabilities of large models, they have shown great potential in natural language interaction, knowledge reasoning, task planning, etc. AIAgent is taking over the big language model and has become a hot topic in the current AI circle. Au

Hongmeng Smart Travel S9 and full-scenario new product launch conference, a number of blockbuster new products were released together Hongmeng Smart Travel S9 and full-scenario new product launch conference, a number of blockbuster new products were released together Aug 08, 2024 am 07:02 AM

This afternoon, Hongmeng Zhixing officially welcomed new brands and new cars. On August 6, Huawei held the Hongmeng Smart Xingxing S9 and Huawei full-scenario new product launch conference, bringing the panoramic smart flagship sedan Xiangjie S9, the new M7Pro and Huawei novaFlip, MatePad Pro 12.2 inches, the new MatePad Air, Huawei Bisheng With many new all-scenario smart products including the laser printer X1 series, FreeBuds6i, WATCHFIT3 and smart screen S5Pro, from smart travel, smart office to smart wear, Huawei continues to build a full-scenario smart ecosystem to bring consumers a smart experience of the Internet of Everything. Hongmeng Zhixing: In-depth empowerment to promote the upgrading of the smart car industry Huawei joins hands with Chinese automotive industry partners to provide

See all articles