On-device ML: Artificial Intelligence in your pocket
Priyanka Kulkarni21:592023
Qualche centinaio di megabyte di modello può segnare la fine di un'app mobile
Un tipico modello di deep learning pesa qualche centinaio di megabyte e i sondaggi indicano che la mancanza di spazio di archiviazione e il consumo della batteria sono i motivi più comuni per cui si disinstallano le app. I team che portano l'AI dal cloud agli smartphone devono vincere contemporaneamente su memoria, velocità e sicurezza, spesso su dispositivi di fascia medio-bassa. Priyanka Kulkarni, senior machine learning engineer di Adobe, traccia la mappa di questo terreno: come si riduce, si accelera e si protegge un modello che vive nella tasca di un cliente?
Scopra le strategie di compressione, accelerazione e watermarking che rendono praticabile il ML on-device
Priyanka Kulkarni, Senior Machine Learning Engineer di Adobe, spiega cosa serve per portare i modelli di deep learning dai server cloud agli smartphone e ad altri dispositivi edge. Affronta tre sfide (dimensione del modello, efficienza del modello e sicurezza) e illustra compressione, neural architecture search, acceleratori hardware, watermarking dei modelli e federated learning come strumenti per superarle.
“Un'app di grandi dimensioni è una condanna a morte sul mobile.”
“Quindi mantenere bassa la dimensione del modello mobile e bassa la latenza è davvero non negoziabile.”
What you will learn
Valutare i vantaggi in termini di costi, latenza, connettività e privacy dell'esecuzione dei modelli sul dispositivo anziché nel cloud.
Scegliere architetture adatte al mobile come EfficientNet, MobileNet o MobileViT e ridurle con pruning, knowledge distillation e quantizzazione.
Usare la neural architecture search e reti scalabili in stile Once-for-All per servire diversi ambienti hardware senza ripartire ogni volta da zero.
Diagnosticare il jank causato dalla contesa della GPU e adattare i layer del modello ad acceleratori hardware come XNNPACK o l'Apple Neural Engine.
Proteggere la proprietà intellettuale dei modelli distribuiti con crittografia, offuscamento, limiti alle richieste e watermarking delle reti neurali.
Details
Level
Intermediate
Format
Talk
Technical depth
Practitioner
For
Mid-career, Senior individual contributor
Length
21:59
Published
June 2023
Questions this talk answers
Perché eseguire il machine learning sul dispositivo anziché nel cloud?
L'inferenza on-device evita i costi di data center e banda e funziona a prescindere dalla connettività. Offre agli utenti risultati in tempo reale e mantiene privati i loro dati, perché non devono mai essere inviati o archiviati su un server.
Perché la dimensione del modello è un vincolo così critico sul mobile?
Un tipico modello di deep learning occupa qualche centinaio di megabyte e un'app di grandi dimensioni è una condanna a morte sul mobile, soprattutto nei mercati emergenti dove prevalgono smartphone di fascia medio-bassa. La relatrice ha citato sondaggi secondo cui la mancanza di spazio e il consumo della batteria sono i motivi più comuni di disinstallazione.
Che cos'è il jank e come possono ridurlo i team di ML on-device?
Il jank consiste in frame a scatti che compaiono quando la GPU gestisce contemporaneamente il rendering dell'interfaccia e l'inferenza del modello. I team possono profilarlo con gli strumenti per sviluppatori di iOS e Android, adattare i layer agli acceleratori hardware e distribuire il calcolo dei layer tra più acceleratori.
Come può un'azienda proteggere un modello una volta distribuito sul dispositivo di un utente?
Le pratiche comuni includono crittografia, offuscamento e limitazione del numero di richieste per contenere gli attacchi avversari. Il watermarking delle reti neurali aggiunge segnali di proprietà nascosti che non incidono sull'accuratezza e resistono ai tentativi di rimozione.
Come potrebbe funzionare un watermark in un modello linguistico come ChatGPT?
Una tecnica proposta seleziona token specifici da un insieme casuale e li favorisce leggermente durante la generazione. I lettori comuni non se ne accorgerebbero, ma un investigatore potrebbe risalire alla selezione dei token per dimostrare che il testo proviene dal modello.
Perché le dimensioni dell'app sono una condanna a morte sul mobile (48 s)
Proteggere i modelli di AI che vivono sui dispositivi degli utenti (63 s)
Come potrebbe funzionare un watermark nascosto in ChatGPT (43 s)
All right. I guess we can get started. Hello, everyone. Hope you're all doing well. And thank you for attending this session. I'm Priyanka Kulkarni, and I specialize in building neural networks for on-device deployments at Adobe. Today, I'm going to talk about building on-device machine learning solutions to create, and I'm going to talk about building on-device machine learning solutions to create new technologies.
An AI-powered future that is fast, reliable, and secure. It's no surprise that mobile has become a predominant surface for AI interactions. We all want machine learning-powered magic at our fingertips everywhere we go. You all have probably used some form of AI on your phones for work, for travel, for shopping, or simply because you're bored. And there's tremendous demand rising for apps like digital assistants or face recognition and augmented reality.
An AI-powered technology, where people are reaching for their phones to engage with AI daily. An AI-powered technology. This has led to a huge uptick in the mobile AI market, now worth billions of dollars and rising. Recent studies have shown that applications that have advertised their association with OpenAI or ChatGPT, have seen their revenues jump dramatically in the past few months, as consumer demand around these technologies have skyrocketed. As more and more apps are incorporating machine learning into their offerings, This intelligence is moving closer to the edge where the computations are locally rather than in the cloud.
So in today's talk, I'll touch upon why on-device machine learning is important and relevant today more than ever, understanding the risks and challenges that come with the fabric of mobile platforms, including the security ones, and strategies that we can adopt to push the boundaries of neural network deployment across edge surfaces. The typical state-of-the-art neural networks are so large and computationally expensive that they require huge data centers with clusters of CPUs and GPUs to be able to run them.
They are too big to fit on edge devices and expensive to even run inference. So add to this bandwidth costs of transferring the data from the user's devices to the cloud, and you can tell that all of this adds up really quickly. On-device machine learning means that you can save all of these costs. This is also great for customers because now they can enjoy the benefits of access everywhere, regardless of connectivity, get instantaneous or real-time results, and assure data privacy.
Nobody likes the delay when the data is being streamed to the cloud, processed over there, and then sent back. And we can skip this whole hassle with on-device models. And because the data doesn't have to be sent to the server or stored there, there are fewer opportunities for cyber criminals to exploit any vulnerabilities, which also helps to preserve the sanctity of the data.
Now, integrating machine learning on the edge is nothing new, but the explosion of ML models in the world around us poses an increasingly difficult challenge to fit all of these intelligent systems onto resource-constrained devices like our mobile phones, which have limited compute, battery, memory, storage. Add to this mix, the generative AI race. I'm guessing you all have seen or heard about the mania around ChatGPT, DALI, mid-journey, and their mind-boggling abilities to write essays or create art.
I mean, I've been hooked to those apps for too many hours. And as generative AI is booming, so are the costs of running these models. They are way too large by smartphone standards and cannot be just taken off the shelf and run on our phones. So you can guess what the first challenge with on-device machine learning is, the model size and capacity.
We need a model that's small and fast, yet can provide high accuracy on the intended task. A large app size is the death knell on mobile. This is especially so in emerging markets around the world, where mid to low range smartphones are the majority. So we can't have our machine learning models driving up the app sizes by a few hundred megabytes, which is a typical size of a deep learning model.
A smaller size of the model also means we have fewer parameters than usual for the model to learn the task effectively. And in addition to this, we need to invest in accelerating the model inference so that we can provide users with low latency. These challenges are highlighted by innumerable surveys that show that a lack of storage space or battery running apps are the most common reasons for mobile app uninstalls.
So keeping the mobile model size low and the latency low is really non-negotiable. Finding this trade off between model accuracy and latency has become key in research as well. For instance, this chart tells us the relationship between a model's accuracy and its latency as we scale up the size. Each color here represents a specific architecture. And from looking at this, we know that the purple architecture gives us a really big boost for accuracy for a comparatively small increase in latency.
So it must be a really efficient model. And so happens that this model is also named efficient net. So it seems like a really good candidate for on-device models. In the bubble chart on the right, the size of each bubble represents how many parameters each model has. Here we see that the older models called BGG nets are the biggest models here and were created with a staggeringly high number of parameters.
Over time, though, research has taken machine learning models towards the direction of using fewer parameters and fewer operations while maximizing accuracy. And this is evident from the concentration of the models towards the top left section of the chart compared to where the old BGG models had started out. So it's great news that literature and industry is taking notice of how models can be made smaller as well as more efficient, which bodes well for on-device ML.
Typically, we've seen so far that convolutional neural networks remain the dominant choice for mobile deployments, where a majority of the deep learning models on mobile devices were some variant of mobile net. Mobile net architectures were developed with the intention to address the resource bottleneck seen on mobile. But over the past couple of years, the landscape of deep learning has been completely revolutionized with the advent of transformer based models.
These models have several advantages over CNNs, including introduction of attention layers for better information mapping and learning, as well as nuanced understanding of language. Following this, there's also been an interest of adapting transformers for mobile. However, they have been far more challenging to convert and run on device as compared to CNNs because they have more complex layers, higher floating point ops, and also exhibit much higher memory usage.
In attempts to optimize transformer models, so far we have seen that we've achieved varying degrees of mobile friendliness. This has raised the question if we can design architectures that are as mobile friendly as continents, but as efficient and accurate as transformers. A number of hybrid architecture designs have been proposed for combining advantages of CNNs with transformers for maximum efficiency, and mobile VIT is one of them where local processing done in convolutions are replaced with global processing using transformers.
Now, the selection of model architecture is crucial, but we also need to optimize the model further by shrinking it as much as we can. For this, we can use model compression techniques. This domain has seen various techniques developed over time and is widely being used already in literature and industry. These include things like network pruning to get rid of redundant or less important neurons, knowledge distillation from a teacher model to a smaller student model, as well as quantization to lower precision values.
As effective as these techniques have been, they are not that easy to automate, and it involves a lot of manual cumbersome tweaking and tuning to squeeze out every bit of optimization we can get, which is indispensable and goes a long way for mobile deployments. To combat manual tuning of models, you may have heard about the rise in popularity of neural architecture search.
So this is the process of automating the design of neural networks, where you search amongst various combinations of layers to create an architecture for your model requiring minimal human intervention. This is a fantastic way to find an optimal and efficient model where we can search for architectures that would work great for mobile. But what happens when we have diverse deployment scenarios on the edge like mobile browser or web.
These all present different resources as well as limitations for deployment. So we could deploy the same model across all of them, but then we'd be limited by the most constrained environment and end up being wasteful or inefficient in the others. So why not use neural architecture search to find a model tuned for each specific hardware environment. So this is a great idea.
But as these environments increase and scale, instead of rerunning neural architecture searches each time, we would want to find an effective way of walking the accuracy and latency curve for these models so that we can have greater flexibility and velocity to market. There has been interesting research in this field of scalable architectures, one research group at MIT has published a solution called once for all that attempts to tackle this problem.
And what they've proposed is training a single giant network, which we can then sample for smaller specialized sub networks of different sizes and different capacity, and then deploy them in various scenarios and target hardware. Also, not to forget that scalable architectures are like once for all ensure we're heading into the next generation of AI responsibly, because then these searches are targeted and optimized, so they are far better for the environment than traditional neural architecture search engines.
The second challenge with on-device ML is model efficiency. Due to resource limited environments on edge devices, our model needs to maximize its efficiency to consume the least amount of resources it can. This could be compute or memory. The on-device hardware landscape is also very diverse, especially on Android, where there are so many different manufacturers and hardware makers, leading to a spectrum of diverse resource limitations across all devices.
On mobile, this resource limitation often results in a contention problem, which if not handled properly can result in a symptom observed called jank. Consider a scenario where the GPU is simultaneously being called upon for UI graphics rendering requests, as well as running inference on machine learning models. This is common with real-time or interactive ML features where a user could be scrolling on his or her phone while the machine learning model is running simultaneously in the background.
In this case, you would get an experience like you see on the left-hand side, where there are more stuttering frames during the scroll. And this is called jank. While the right side presents a smoother scrolling experience for the user. There are now a lot of mobile developer tools available on iOS and Android to help us profile as well as measure jank.
We can mitigate against it. The CPU and GPU are not the only resources available on mobile. There are diverse set of hardware accelerators available across all platforms. One example is the XNN pack on TensorFlow Lite, which is a highly optimized library that enables faster CPU performance, including speed up of quantized models. Likewise, on iOS, the Apple neural engine is a special type of processor unit that you can leverage to make your ML models really fast by accelerating operations like convolutions and matrix multiplies.
There are a lot of other companies besides Apple developing their own AI accelerator chips, and you might have heard of Google's sensor processing unit as well. Even with all of these diverse hardware accelerators, there's a possibility that your ML model may not be able to use all of them. Many common layers seen in machine learning models may not be supported.
So we need to tailor our models to make the layers compatible with the accelerators that we intend to use. We can also parallelize the inference by developing an intelligent system to delegate and distribute the load of computing different layers using different accelerators. And this becomes even more critical when we have to run multiple ML models in parallel where they're all contending for the same device resources.
The third challenge of on-device ML is security. A significant amount of time, costs, data, and resources go into the development of each deep learning model, and it's critical to protect its intellectual property. When we deploy a deep learning model to the edge or on-client devices, they are far more vulnerable there than when they're queried using APIs in the cloud.
Thinking about the cybersecurity aspect of model protection is crucial. There are a lot of common best practices to safeguarding your deep learning model, like encryption, obfuscation, as well as limiting the number of requests to curb the potential for adversarial attacks. There's also research being done for embedding ownership signals into deep learning models directly, called watermarking. So this is similar to the watermarking techniques used to protect creator rights for digital images, video, and audio, and it has been a really effective technique to prove the ownership, authenticity, or integrity of these creations.
Neural network watermarking is a bleeding edge area of research to incorporate IP protection into deep learning models. These techniques aim at embedding ownership signals by inserting watermarks or backdoors into models that are so well disguised that it's hard to detect them. Aside from acting as the ownership proof, they do not affect the accuracy of the model and exhibit no other behavior.
And lastly, the watermark also persists against adversarial attacks, which makes it difficult or impossible to remove it. There's been some exciting research in extending this domain for watermarking generative AI models too. Watermarking gen AI is imperative not only to protect intellectual property, but also to prevent potential future malicious uses of language models like plagiarism, misattribution, misuse, or abuse of the outputs.
Recently, OpenAI also announced that they are planning to stop ChatGPT users from cheating on their homework or making social media bots by watermarking outputs produced by their models so that you can have a trace back to identify that they originated from ChatGPT. There are also recent research papers that have proposed frameworks for watermarking proprietary language models and already proven that the watermark can be embedded with negligible impact on the text quality in the outputs.
There are other challenges and security risks of generative AI models that need to be addressed. One is their vulnerability to training data extraction attacks. There is a potential risk that these models leak details about the data on which they've been trained. This point was raised in a research paper where they showed that if one prompts the GPT-2 language model with a particular prefix, it auto-completes a long block of text that contains sensitive and personally identifiable information, including contact details and the physical address of a particular person whose information was included in the model's training data.
There have been a lot of exciting developments in the field of optimizing and scaling down generative AI models, which will help pave the way for eventual on-device deployment. We're already seeing that these generative language models of different sizes and capacities can accomplish a variety of different tasks. So, while the larger models can pass college level exams or the bar exam, the smaller models can still achieve the ability of reading comprehension and logical deduction.
This is a great sign and helps us understand how to fine tune these models for business specific tasks or use cases and how we can optimize them for on-device. There's also a lot of promising evidence of running large scale AI with fewer parameters. For instance, the models like stable LM and Meta's Lama model have only around a few billion parameters.
This sounds like a lot, but these are vastly optimized models compared to the GPT models, which have hundreds of billions of parameters and have no hope in the world of running on smartphones. More recently, Web LLM is a project that brings large language models and chatbots to web browsers. So, everything is run inside the browser without any server support and it also leverages Web GPU acceleration.
Recently, Squeezebits also claim that they have optimized image generation models from stable diffusion to be able to run it on an Android phone, which is just astonishing. And why stop at only inference for on-device ML? We can also train and update these models locally without the data ever leaving the user's devices. Models can be fine-tuned to achieve better flexibility as well as offer personalization.
This concept can then extend to federated learning, which marries the advantages of on-device training with cloud training. So, you get the privacy benefit and the scale of on-device learning by keeping the data local closer to the user. And you get the benefit of learning from diverse data across users by having the cloud aggregate many locally trained models.
I'm so excited to see the proliferation of AI based services around us and the ability of running these lightweight personalized models locally on our phones will help us unlock the full potential. So, thank you all for listening. And with that, I'm happy to take any questions. Please feel free to drop any questions in the Q&A chat pod as well, and I can get to them offline too.
Okay, so we have a question from Sandra. What could be an example of a watermark in chat GPT? So, that's a great question, Sandra. One of the language models behind all of these chat GPT and prior technologies have a proposed watermarking technique, which the company isn't currently using, but the architecture behind these language models involve the use of transformers.
Which are composed of blocks that leverage tokens. And an example of a watermark is to select specific tokens from random set and softly promote the use of those specific tokens when generating the output. So, these watermarks would not be visible to a layman when chat GPT produces certain outputs. But if I'm someone who's a legal authority who would want to then investigate and trace it back, I can run reverse engineering using the token selection to be able to uncover and prove that this watermark originated from chat GPT.
But if I'm just a general user who's just going through a paragraph produced by chat GPT, it would be sort of masked from me. I have another question from Deborah. Can you explain a bit about the on-device and consolidated data with an example? Sure. So, you can think of it as each of us having smaller localized models with fewer parameters that learns to give us specific types of responses.
So, I might be having slightly different tolerance for bias or outputs of a language model compared to someone else. So, that would be really important. So, I think it would be very important. It would be very important to reflect my interests, my ethics, my values. Whereas, the larger models would get an aggregated version of all of our phones to reflect what general customers, you know, the mean average of customers would expect.
So, that helps to keep data local to me and a model that's personalized to my beliefs and my interests while also updating the larger models on server that reflects the aggregate data across all of the users without infringing privacy. I hope that helps answer your question. Thank you. And I think we're out of time. Thank you all for attending this session.
I really appreciate it. And please feel free to connect with me. All right. Have a great day, everyone.
Transcribed automatically; names checked against the speaker record. Select a time to jump there.
Article based on this talk
Cosa serve per eseguire il deep learning su uno smartphone
Priyanka Kulkarni di Adobe scompone il machine learning on-device in tre sfide (dimensione, efficienza e sicurezza) e nelle tecniche per affrontare ciascuna.
In breve
Eseguire l'AI sul dispositivo anziché nel cloud riduce i costi di server e banda, elimina la latenza e mantiene privati i dati degli utenti, ma solo se il modello è piccolo, efficiente e protetto. Priyanka Kulkarni, Senior Machine Learning Engineer di Adobe, descrive il ML on-device come un triathlon di memoria, velocità e privacy, e illustra le architetture, i metodi di compressione, gli acceleratori hardware e le tecniche di watermarking che lo rendono possibile.
Punti chiave
Capire come accelerare il percorso dal server al mobile per il deployment di reti neurali di deep learning.
Comprendere i rischi e le sfide legati al deployment di reti neurali sul dispositivo.
Comprendere le implicazioni di sicurezza del deployment di reti neurali sul dispositivo e quali soluzioni e strategie adottare per proteggere la propria proprietà intellettuale.
Comprendere la struttura delle piattaforme di deployment mobile sia per Android sia per iOS.
Spingere oltre i limiti del machine learning sul mobile.
Perché l'AI si sta spostando dal server
Kulkarni parte dall'osservazione che il mobile è diventato una superficie predominante per le interazioni con l'AI, dagli assistenti digitali al riconoscimento facciale fino alla realtà aumentata. Le reti neurali allo stato dell'arte, però, sono pensate per data center pieni di CPU e GPU. Se si aggiunge il costo di trasferire i dati degli utenti nel cloud e ritorno, la spesa cresce rapidamente.
Il machine learning on-device elimina questi costi e offre agli utenti qualcosa di meglio: accesso indipendente dalla connettività, risultati in tempo reale e maggiore privacy. Come dice lei: "A nessuno piace il ritardo mentre i dati vengono inviati al cloud, elaborati lì e poi rimandati indietro." (2:38) Poiché i dati non devono essere inviati o archiviati su un server, ci sono anche meno varchi da sfruttare per gli attaccanti.
Prima sfida: dimensione e capacità del modello
Gli smartphone hanno capacità di calcolo, batteria, memoria e spazio di archiviazione limitati, e il boom dell'AI generativa ha solo reso i modelli più grandi. Kulkarni è diretta sulle conseguenze: "Un'app di grandi dimensioni è una condanna a morte sul mobile." (3:50) Osserva che un tipico modello di deep learning occupa qualche centinaio di megabyte e che questo pesa soprattutto nei mercati emergenti, dove gli smartphone di fascia medio-bassa sono la maggioranza. Come ha citato la relatrice, i sondaggi mostrano che la mancanza di spazio e il consumo della batteria sono i motivi più comuni per cui si disinstallano le app. La sua conclusione: "Quindi mantenere bassa la dimensione del modello mobile e bassa la latenza è davvero non negoziabile." (4:38)
La scelta dell'architettura è la prima leva. Con l'aiuto di grafici tratti dalla ricerca, indica EfficientNet come un modello che guadagna molta accuratezza a fronte di un piccolo aumento di latenza, e mostra come il settore si sia allontanato dalle reti VGG ricche di parametri. Le varianti di MobileNet hanno finora dominato il mobile, mentre i transformer portano layer di attention e una migliore comprensione del linguaggio, ma sono più difficili da eseguire sul dispositivo. Architetture ibride come MobileViT cercano di combinare il meglio di entrambi.
La compressione è la seconda leva: pruning dei neuroni ridondanti, distillazione della conoscenza da un grande modello teacher a uno student più piccolo e quantizzazione a precisione inferiore. Poiché questa messa a punto è manuale e laboriosa, sottolinea il valore della neural architecture search, che automatizza la progettazione della rete. Quando un modello deve funzionare in più ambienti, come mobile, browser e web, un unico modello impone un compromesso: "Quindi potremmo distribuire lo stesso modello su tutti, ma saremmo limitati dall'ambiente più vincolato e finiremmo per essere dispendiosi o inefficienti negli altri." (8:45) Descrive Once-for-All, di un gruppo di ricerca del MIT, che addestra una grande rete e ne estrae sottoreti specializzate più piccole per ciascun target, un approccio che a suo dire è anche migliore per l'ambiente rispetto a ricerche ripetute.
Seconda sfida: efficienza, jank e acceleratori
La seconda sfida è sfruttare al massimo un hardware scarso e molto eterogeneo, soprattutto tra i numerosi produttori Android. Quando alla GPU si chiede di eseguire il rendering dell'interfaccia e l'inferenza nello stesso momento, gli utenti vedono frame a scatti, il cosiddetto jank. Gli strumenti per sviluppatori di iOS e Android ora aiutano i team a profilarlo e misurarlo.
Kulkarni indica acceleratori hardware oltre a CPU e GPU: XNNPACK in TensorFlow Lite per prestazioni CPU più rapide e modelli quantizzati, l'Apple Neural Engine per operazioni come convoluzioni e moltiplicazioni di matrici, e la Tensor Processing Unit di Google. Non tutti i layer sono supportati ovunque, quindi "Dobbiamo adattare i nostri modelli per rendere i layer compatibili con gli acceleratori che intendiamo usare." (12:21) I team possono anche costruire sistemi che distribuiscono i layer tra gli acceleratori, il che diventa cruciale quando più modelli competono per lo stesso dispositivo.
Terza sfida: sicurezza e watermarking
Ogni modello rappresenta un investimento significativo di tempo, dati e denaro, e distribuirlo sui dispositivi degli utenti lo espone. "Quando distribuiamo un modello di deep learning sull'edge o sui dispositivi client, è molto più vulnerabile lì rispetto a quando viene interrogato tramite API nel cloud." (12:47) Le difese standard includono crittografia, offuscamento e limitazione delle richieste per contenere gli attacchi avversari.
Passa poi al watermarking delle reti neurali, un'area di ricerca d'avanguardia che incorpora in un modello segnali di proprietà nascosti o backdoor. Un buon watermark non incide sull'accuratezza, non mostra altri comportamenti e resiste ai tentativi avversari di rimuoverlo. L'idea viene estesa all'AI generativa, dove potrebbe aiutare contro plagio, attribuzione errata e uso improprio. Ricorda che OpenAI ha annunciato l'intenzione di applicare un watermark agli output di ChatGPT, e cita un articolo di ricerca che mostra come GPT-2 potesse essere indotto, tramite prompt, a rivelare informazioni personali presenti nei dati di addestramento. Nella sessione di domande spiega una tecnica proposta: favorire leggermente token specifici scelti da un insieme casuale, invisibili ai lettori ma tracciabili da un investigatore.
AI generativa e federated learning sul dispositivo
Kulkarni chiude con i progressi nella riduzione dei modelli generativi. Modelli come StableLM e LLaMA di Meta hanno qualche miliardo di parametri, contro le centinaia di miliardi dei modelli GPT; WebLLM esegue modelli linguistici nel browser tramite WebGPU; e SqueezeBits afferma di eseguire la generazione di immagini con Stable Diffusion su uno smartphone Android. Poi si spinge oltre: "E perché fermarsi solo all'inferenza per il ML on-device? Possiamo anche addestrare e aggiornare questi modelli localmente, senza che i dati lascino mai i dispositivi degli utenti." (17:06) Il federated learning combina questa personalizzazione locale e privata con l'aggregazione nel cloud di molti modelli addestrati localmente, così il modello condiviso impara da utenti diversi senza raccoglierne i dati.
Guarda il talk
"On-device ML: Artificial Intelligence in your pocket" di Priyanka Kulkarni, 22 minuti: https://www.womentech.net/video/device-ml-artificial-intelligence-in-your-pocket
La relatrice
Priyanka Kulkarni è Senior Machine Learning Engineer di Adobe, dove lavora all'innovazione AI di nuova generazione per i dispositivi mobili e sviluppa reti neurali per il deployment on-device ed edge. Negli ultimi cinque anni ha applicato il deep learning all'addestramento, alla compressione e all'ottimizzazione dei modelli, alla protezione della proprietà intellettuale e al deployment mobile per l'analisi e il rilevamento di immagini di documenti, e ha conseguito un master alla Carnegie Mellon University con specializzazione in mobile and pervasive computing.
Domande a cui risponde questo talk
Perché eseguire il machine learning sul dispositivo anziché nel cloud?
Perché la dimensione del modello è un vincolo così critico sul mobile?
Che cos'è il jank e come possono ridurlo i team di ML on-device?
Come può un'azienda proteggere un modello una volta distribuito sul dispositivo di un utente?
Come potrebbe funzionare un watermark in un modello linguistico come ChatGPT?
Bozza redatta con l'AI a partire dalla trascrizione del talk. Revisione editoriale in attesa.
Frameworks and ideas mentioned
Neural architecture search
Once-for-All
Network pruning
Knowledge distillation
Quantization
Neural network watermarking
Federated learning
Resources mentioned
TensorFlow Lite XNNPACK
Apple Neural Engine
Once-for-All (MIT)
WebLLM
Cite this talk
Priyanka Kulkarni. "On-device ML: Artificial Intelligence in your pocket." WomenTech Network, 2023. https://www.womentech.net/video/device-ml-artificial-intelligence-in-your-pocket