OFFICE16 ai.exe

Anonymous
2022-11-07T15:32:58+00:00

My AMD Software is picking up on an active exe deeply rooted in microsoft office. This process is causing lag on my machine does anyone know what it is?

The full path to the file is as follows: C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\ai.exe

Microsoft 365 and Office | Install, redeem, activate | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2023-01-01T09:08:10+00:00

    Local Artificial Intelligence ( AI ) in Microsoft Office desktop apps on Windows was recently moved out-of-process. In other words, Office desktop apps ( like Word, Outlook, PowerPoint, etc. ) now communicate with another program ( ai.exe ) to perform most local AI.

    For Microsoft Office desktop apps on Windows, the following are the main binaries associated with local AI:

    • aitrx.dll: The transceiver ( trx ) library loaded by Office desktop apps to transmit inputs to and receive outputs from ai.exe.
    • ai.exe: The executable used to host ai.dll. This executable receives inputs from aitrx.dll in an Office desktop app, runs those inputs through ai.dll to get the associated outputs, and transmits those outputs back to aitrx.dll in the Office desktop app.
    • ai.dll: The main library containing various AI functionality ( esp. from the onnxruntime and onnxruntime-extensions ).
    • mlg.dll: A natural language processing related library loaded as needed by ai.dll. This contains code created by Microsoft's Machine Learning Group ( MLG ).
    • aimgr.exe: The manager ( mgr ) executable used to manage various instances of ai.exe across Office desktop apps. Note: At the time of this reply, this executable is not yet enabled outside of Microsoft.

    For a typical Office x86 click-to-run installation, these binaries are at the following two locations:

    • Primary ( x86 ): %ProgramFiles(x86)%\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\Office16\
    • Secondary ( x64 ): %ProgramFiles(x86)%\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\

    For a typical Office x64 click-to-run installation, these binaries are at the following two locations:

    • Primary ( x64 ): %ProgramFiles%\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\
    • Secondary ( x86 ): %ProgramFiles%\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\Office16\

    For a typical Office ARM64EC click-to-run installation ( such as Surface Pro 9 with SQ3 processor or Surface Pro X with SQ2 processor ), these binaries are at the following two locations:

    • Primary ( ARM64EC ): %ProgramFiles%\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\
    • Secondary ( x86 ): %ProgramFiles%\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\Office16\

    Note: ARM64EC is the same as "ARM64 (x64 compatible)".

    With that, if you have a recent x64 version of Office installed on your C drive, ai.exe will be located at:

    C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\ai.exe

    All Office binaries are code signed; therefore, all of these binaries are code signed. A valid code signature means that the binary has not been modified after it was code signed. Code signing takes place during official Office builds after source code has been compiled and linked into the various binaries. Here's an example of the valid code signature for ai.exe version 0.12.2 ( part of the latest internal build of Office ):

    This is similar in concept for all other versions of ai.exe.

    AI models that are run by ai.dll can be found in the following two locations:

    • If the model comes with the installation, then the location is:
      • For a typical Office x86 click-to-run installation: %ProgramFiles(x86)%\Microsoft Office\root\Office16\AI\
      • For a typical Office x64 or ARM64EC click-to-run installation: %ProgramFiles%\Microsoft Office\root\Office16\AI\
    • If the model is downloaded from a Microsoft Content Delivery Network ( CDN ), then the location will be under the %USERPROFILE%\AppData\Local\Microsoft\ folder in a subfolder associated with its project name.

    A high-level summary of execution is as follows:

    • Local AI binaries are only loaded if they are used. This means that if you never execute a section of code inside an Office desktop app that requires local AI, then none of the local AI binaries are loaded ... so ai.exe would not be launched.
    • Once local AI binaries are loaded, they remain loaded until the Office desktop app is exited. For example, if you execute a section of code in Outlook that uses an AI model, then ai.exe will launch, load ai.dll, and ai.dll will load and run that model. If you leave Outlook running in the background, then ai.exe will also remain in the background. When Outlook is exited, then ai.exe is exited. ai.exe remains loaded because running any given model generally happens several times during a session, not just once, and it takes a substantial amount of time to launch ai.exe, load ai.dll, and have ai.dll load the model. In other words, ai.exe is retained in memory in order for Office performance to be as fast as possible under these circumstances.
    • Once local AI binaries are loaded, they will reload themselves as needed. For example, if you execute a section of code in Outlook that uses an AI model such that ai.exe has launched, loaded ai.dll, and ai.dll has loaded and ran the associated AI model, if ai.exe is killed and you execute another section of code in Outlook that uses that model, the ai.exe for that model will relaunch, reload ai.dll, and ai.dll will reload and run that model.
    • A distinct ai.exe is loaded for each distinct AI model. For instance, if Outlook uses three distinct AI models, then three distinct ai.exe will be launched to enable process isolation between the models. If one goes down ( say due to an unexpected crash ), it doesn't take down the other two along with it ... and most importantly, it also doesn't take down Outlook with it.

    Local AI was moved out-of-process for multiple reasons. Here are two of those reasons:

    • To minimize the memory consumption within Office desktop apps on Windows. Background: Due to Office's long history, some Enterprise and Consumer Customers still use Office x86 desktop apps since they have important x86 add-ins made by companies that either no longer exist or no longer provide extended support, so x64 or ARM64EC versions of those add-ins cannot be created. Office x86 desktop apps are 32-bit executables where the maximum memory size available is only 4 GiB. When a x86 app makes an allocation request for any amount of memory that would cause the total amount of memory to exceed 4 GiB, that request is denied and the app handles that denial. Most AI models ( esp. neural network models ) consume a substantial amount of memory. Moving the vast majority of AI memory consumption out-of-process enables an Office x86 app to conserve memory inside that app for other important purposes.
    • To minimize the memory consumption across Office desktop apps on Windows. Background: Regardless if you are using the x86, x64, or ARM64EC version of Office desktop apps, the computer running those apps has a finite amount of physical memory. When the same AI model is used in multiple apps ( such as the same natural language processing model in Word and Outlook ), that model is currently loaded once per app ( more precisely, once per process ). That model is not currently shared between apps. Moving local AI out-of-process is the first of multiple steps toward sharing AI models between Office desktop apps so that we can conserve physical memory on the computer for other important purposes.

    Questions and Answers:

    • Question: Why is AMD identifying "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\ai.exe" as "Alien Isolation"? Answer: Because that AMD software is either configured incorrectly or currently has a "bug". If that AMD software is configured correctly, then please make a bug report to AMD so that they can fix that issue. A quick web search suggests that bug reports to AMD can be made using https://www.amd.com/en/support/kb/faq/amdbrt ; however, please ensure you verify if this link is actually relevant for your AMD software or if a better link exists.
    • Question: What happens if I rename "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\ai.exe" to some other filename ( such as XXai.exe )? Answer: Local AI in Office will no longer work ( internally, local AI related calls will just immediately fail ). During the next Office update ( at a minimum, this happens each month, but can happen more often depending on your Update Channel ), ai.exe will be restored if there were any changes.
    • Question: Does "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\ai.exe" currently impact the GPU? No, neither aitrx.dll, ai.exe, ai.dll, mlg.dll, nor aimgr.exe are currently compiled to use the GPU. For those that know about the ONNX Runtime's Execution Providers, only the CPU Execution Provider is currently used. This will change in the near future, but for now, local AI in Office desktop apps using these binaries only leverages the CPU.
    • Question: Does "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\ai.exe" contain malware or is it a virus or is it some similar exploit? No, the local AI binaries do not contain malware, do not contain viruses, and do not contain any similar exploits like that ... so as long as ai.exe is coming from the Office paths mentioned above and remains code signed by Microsoft ( i.e. has not been modified since it was signed during its official Office build ), then ai.exe remains good to go. If your anti-virus software or anti-malware software is detecting ai.exe as malware, a virus, or some similar type of exploit at that Office location and its valid code signature is still intact, then your anti-virus software or anti-malware software most likely has a "bug" in its malware/virus detection algorithm. Please make a bug report with the vendor of that anti-virus software or anti-malware software. While it is always possible that nefarious folks have circumvented all of the safeguards, extensive defense-in-depth measures, and exhaustive security scanning that have been added over the years and found a way to add malicious code prior to code signing, that probability is very low ... so: possible, but not probable.

    Aside:

    • Local AI in Office desktop apps on macOS, in Office mobile apps on Android and iOS, and in Office web browser apps and in progressive web apps is currently still performed in-process.
    • Remote AI ( such as calling an Office-related large language models hosted in Azure Machine Learning ( AML ) Managed Online Endpoints ) in Office desktop apps on Windows is currently still performed in-process.

    Hope This Clarifies

    412 people found this answer helpful.
    0 comments No comments

30 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-12-03T14:21:14+00:00

    My Malwarebytes detects this as an exploit.

    After reading this post I deleted:

    ai application located in mentioned path along with ai dll.

    I changed them to read only & saved them into a zip file

    Word and windows works fine.

    This is report from malwarebytes:

    Exploit: 1

    Exploit.PayloadProcessBlock, C:\Program Files (x86)\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\ai.exe 1C254BF0-764D-4535-BBD7-EABED544CD2E 2E72BBCF-23FA-475A-8F64-09824235E59D 12048, Blocked, 0, 392684, 0.0.0, ,

    -Exploit Data-

    Affected Application: Microsoft Office Word

    Protection Layer: Application Behavior Protection

    Protection Technique: Exploit payload process blocked

    File Name: C:\Program Files (x86)\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\ai.exe 1C254BF0-764D-4535-BBD7-EABED544CD2E 2E72BBCF-23FA-475A-8F64-09824235E59D 12048

    URL:

    13 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2022-11-07T21:31:03+00:00

    Dear Matteus,

    Good day! Thanks for posting in the community. We are happy to help you.

    Based on my search, there is no official documentation mentioning this file or related information about files under this path. For your query, I would like to suggest you:

    1. If you are using a Business account (Work or school account), please contact your admin/IT department and let them create a support ticket via Microsoft 365 Admin Center> Support> New service request. That support team there will have the correct channel to help you investigate more and provide a detailed explanation.
    2. If you are using a personal account (Microsoft account), please send feedback on Microsoft Office.

    Also, we welcome community members to share information about your concern if one has related experiences.

    Sincerely,

    George | Microsoft Community Moderator

    [Updated by George Jiang MSFT 11:09 PM 11/22 2022 UTC + 8]

    5 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2022-11-07T21:47:28+00:00

    Hi,

    Thank you for your reply. I'm a home office 365 user.

    Best wishes,

    Matt

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2022-11-11T18:59:57+00:00

    I have the same question. It wasn't there before this last smaller update a couple of days ago, and I can't find any concrete info on it.

    7 people found this answer helpful.
    0 comments No comments