{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Federico Trotta",
  "title_listed": "A Gentle Introduction To Generative AI For Beginners",
  "keywords": "生成式AI,入门",
  "domain": "大模型算法",
  "content_type": "深度技术解析",
  "is_paid_flag": "部分免费/会员墙",
  "url": "https://towardsdatascience.com/a-gentle-introduction-to-generative-ai-for-beginners-8c8752085900/",
  "publish_date": "2023-06",
  "corpus_stage": "预训练/SFT",
  "notes": "",
  "id": "6938a5a35a24",
  "collected_at": "2026-10-02T00:40:13",
  "title": "A Gentle Introduction To Generative AI For Beginners | Towards Data Science",
  "body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\n# A Gentle Introduction To Generative AI For Beginners\nLet's understand the big picture behind generative AI\n[Federico Trotta](https://towardsdatascience.com/author/federicotrotta/)\nJune 29, 20239 min read\n![Image by Susan Cipriano on Pixabay](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1M5-j-eOyAEFHvLlVgblF-Q.jpeg)\nImage by [Susan Cipriano](https://pixabay.com/it/users/susan-lu4esm-7009216/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=8015423) on [Pixabay](https://pixabay.com/it//?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=8015423)\nThe last months have seen the rise of the so-called \"Generative AI\", which is a sub-field of Artificial Intelligence (AI). Tools like ChatGPT have become one of the most spoken words and are becoming fundamental tools for everyday tasks in many jobs ([even to learn to code](https://towardsdatascience.com/how-to-effectively-start-coding-in-the-era-of-chatgpt-cfc5151e1c42)).\nWords like \"[DALL-E](https://medium.com/mlearning-ai/can-i-sell-ai-generated-images-a5d4619c8e1b)\", \"ChatGPT\" and \"Generative AI\" have pervaded socials, media, chats with colleagues, and everything related to our world over the last few months. Literally, everyone is talking about that.\nBut what is generative AI? Why is that any different from \"normal\" AI?\nIn this article, we'll clarify the big picture behind generative AI. So, if you've participated in discussions but don't have clear ideas on this topic, this article is definitely for you.\nLearn this step by step with the interactive [AI Engineer](https://roadmap.sh/ai-engineer), [AI and Data Scientist](https://roadmap.sh/ai-data-scientist), [Computer Science](https://roadmap.sh/computer-science) and [Machine Learning](https://roadmap.sh/machine-learning) roadmaps.\nThis is a discursive explanation to understand the basics of what's behind the scene of generative AI. So, don't worry: you won't find any code here. Just ideas and descriptions and these will be presented in a very short and concise way. In particular, we'll focus on Large Language Models and Image Generation Models.\nHere's a summary of what you'll learn here:\ntext\n\n```\nTable of Contents:\n\nWhat is generative AI and how does it differ from trditional AI?\nLarge Language Models\nImage generation\n```\n\n* * *\n## What is generative AI and how does it differ from traditional AI?\nGenerative AI is a subfield of AI that involves creating algorithms that can generate new data such as images, text, code, and music.\nThe big difference between generative AI and \"traditional AI\" is that the former generates new data based on the training data. Also, it works with types of data that \"traditional AI\" can't.\nLet's say it a little more technically:\n  * \"Traditional AI\" can be defined as discriminative AI. In this case, in fact, we train Machine Learning models so that they can make predictions or classifications on new, unseen data. These ML models can work only with numbers, and sometimes with text (for example, in the case of Natural Language Processing).\n  * In generative AI, we train an ML model and it creates an output that is similar to the data it has been trained on. These kinds of ML models can work with different kinds of data like numbers, text, images, and audio.\n\n\nLet's visualize the processes:\n![The process behind traditional AI. Image by Author.](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1JNe9M643THS5PdL2sqwLAw.png)\nThe process behind traditional AI. Image by Author.\nSo, in traditional AI, we train an ML model to learn from data. Then, we feed it with new and unseen data and it can discriminate, making predictions or classifications.\nRegarding the presented example, we've trained an ML model to recognize dogs from images. Then, we feed the trained ML model with new and unseen pictures of dogs and it will be able to classify whether these new images are representing dogs or not.\nThis is the typical task for a Deep Learning algorithm, in the case of a classification problem.\n![The process behind generative AI. Image by Author.](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1r5aKRUTycNESMYfxxvLUkQ.png)\nThe process behind generative AI. Image by Author.\nIn the case of generative AI, instead, we train an ML model with data from various sources using a vast quantity of data. Then, thanks to a prompt (a query in natural language inserted by a user), the model gives us an output that is similar to the data it's been trained on.\nTo stick to the example, our model has been trained on a massive amount of (text) data that, among others, explains what a dog is. Then, if a user queries the model asking what a dog is, the model will describe what a dog is in natural language.\nThis is the typical task performed by tools like ChatGPT.\nNow, let's see some types of generative AI models.\n* * *\n## Large Language Models\nLet's start to dive into the various kinds of generative AI subfields by starting with Large Language Models (LLMs). [An LLM is](<https://en.wikipedia.org/wiki/Large_language_model#:~:text=A%20large%20language%20model%20(LLM,learning%20or%20semi%2Dsupervised%20learning>.) (from Wikipedia):\n> a computerized language model consisting of an artificial neural network with many parameters (tens of millions to billions), trained on large quantities of unlabeled text using self-supervised learning or semi-supervised learning.\n> Though the term large language model has no formal definition, it often refers to deep learning models with millions or even billions of parameters, that have been \"pre-trained\" on a large corpus.\nSo, LLMs are Deep Learning (DL) models (aka, Neural Networks) trained with millions of parameters on a huge amount of text (this is why we call them \"large\") and are useful to solve some language problems like:\n  * Text classification\n  * Question & Answering\n  * Document summarization\n  * Text generation\n\n\nSo, another important difference between standard ML models is that, in this case, we can train a DL algorithm that can be used for different tasks.\nLet me explain better.\nIf we need to develop a system that can recognize dogs in images as we've seen before, we need to train a DL algorithm to [solve a classification task](https://towardsdatascience.com/classification-metrics-the-complete-guide-for-aspiring-data-scientists-9f02eab796ae) that is: tell us if new, unseen images are representing dogs or not. Nothing more.\nInstead, training an LLM can help us in all the tasks we've described above. So, this also justifies the amount of computing power (and money!) needed to train an LLM (which requires petabytes of data!).\nAs we know, LLMs are queried by users thanks to prompts. Now, we have to spot the difference between prompt design and prompt engineering:\n  * **Prompt design**. This is the art of creating a prompt that is specifically suitable for the specific task that the system is performing. For example, if we want to ask our LLM to translate a text from English to Italian, we have to write a specific prompt in English asking the model to translate the text we're pasting into Italian.\n  * **Prompt engineering**. This is the process of creating prompts to improve the performance of our LLM. This means using our domain knowledge to add details to the prompt like specific keywords, specific context and examples, and the desired output if necessary.\n\n\nOf course, when we're prompting, sometimes we use a mix of both. For example, we may want a translation from English to Italian that interests a particular domain of knowledge, like mechanics.\nSo, for example, a prompt may be:\" _Translate in Italian the following:_\n_the beam is subject to normal stress._\n_Consider that we're in the field of mechanics, so 'normal stress' must be related to it_ \".\nBecause, you know: \"normal\" and \"stress\" may be misunderstood by the model (but even by humans!).\n### The three types of LLMs\nThere are three types of LLMs:\n  * **Generic Language Models**. These are able to predict a word (or a phrase) based on the language in the training data. Think, for example, of your email auto-completion feature to understand this type.\n  * **Instruction Tuned Models**. These kinds of models are trained to predict a response to the instructions given in the input. Summarizing a given text is a typical example.\n  * **Dialog Tuned Models**. These are trained to have a dialogue with the user, using the subsequent responses. An AI-powered chatbot is a typical example.\n\n\nAnyway, consider that the models that are actually distributed have mixed features. Or, at least, they can perform actions that are typical of more than one of these types.\nFor example, if we think of ChatGPT we can clearly say that it:\n  * Can predict a response to the instructions, given an input. In fact, for example, it can summarize texts, give insights on a certain argument we provide via prompts, etc... So, it has features like an Instruction Tuned Model.\n  * Is trained to have a dialog with the users. And this is very clear, as it works with consequent prompts until we're happy with its answer. So, it has also features like a Dialog Tuned Model.\n\n\n* * *\n## Image generation\nImage generation has been around for quite some time, contrary to what one might believe.\nAnyway, in recent times it gained popularity, especially with tools like \"DALL-E\" or \"stable diffusion\" that have cleared their use, making this technology accessible to the masses worldwide.\nWe can say that image generation can be divided into four categories:\n  * **Variational Autoencoders** (VAEs). [Variational autoencoders are](https://en.wikipedia.org/wiki/Variational_autoencoder#:~:text=Variational%20autoencoders%20are%20probabilistic%20generative,first%20and%20second%20component%20respectively.) \"_probabilistic generative models that require neural networks as only a part of their overall structure_ \". In operational words, they encode images to a compressed size and decode them to the original size. During this process, they learn the distribution of the data.\n  * **Generative Adversarial Models** (GANs). These are generally the most known, at least as a word that resonates in the field of generative AI. [A GAN is](https://en.wikipedia.org/wiki/Generative_adversarial_network) \"_a class of ML framework in which two Neural Networks are pith against each other where the gain of one is the loss of the other_ \". This means that one Neural Network creates the image while the other predicts if it is real or fake.\n  * **Autoregressive models**. In statistics, an autoregressive model is the representation of a random process. In the context of generative images, these kinds of models generate images by treating images as a sequence of pixels.\n  * **Diffusion models**. Diffusion models have been inspired by thermodynamics and are definitely the most promising and interesting kinds of models in the subfield of image generation.\n\n\nThis is the process working under the hood of diffusion models:\n  * **Forward distribution process**. We have an initial, iterative, process where the structure of the image is \"destroyed\" in a data distribution. In simple words, is like we iteratively add noise to the image, until all the pixels become pure noise and the image is not recognizable (by the human eye).\n  * **Reverse diffusion process**. Then, there is a reverse diffusion process which is the actual learning process: this restores the structure of the data. It is like our model learns how to \"de-noise\" the pixels to recreate the image.\n\n\n### The power of connecting it all\nIf you maintained the attention until now, a question should naturally pop up in your mind:\" _Ok, Federico, it's clear. But I'm missing something: when I use \"DALL-E\" I insert a prompt and it outputs an image: we haven't talked about that, do we?!_ \".\nNo, we haven't.\nAbove we made a brief description of the most promising (and currently, the most used) model for generating images, but the missing part is the prompt.\nWe've discussed, in fact, how they work at a high level. Meaning: we gave a short explanation of how their learning process works.\nBut the real power of these models arrives when they are coupled with LLMs. This coupling, in fact, gives us the possibility to combine the power of prompt engineering to ask our models for outputs.\nIn other words: we've combined the possibility to use natural language as inputs to models that can actually understand it and can generate images according to it.\nIsn't it a superpower?!?\n* * *\n## Conclusions\nConcluding, we can say that generative AI is a subfield of AI that generates new data similar to the train data.\nWhile, on the one hand, LLMs can generate text based on training data and image generation models can generate new images based on the training images, the real power of generative AI, at least in the case of images, relies on the combination of LLM and models for image generation. This gives us the possibility to create images according to prompts as inputs.\n* * *\n_**NOTE**_ _: this article has been freely inspired by the Generative AI course provided by Google, and some references are taken from it. I suggest_[ _taking this course_](https://www.cloudskillsboost.google/journeys/118) _, for a better understanding of generative AI._\n* * *\n![Federico Trotta](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/07/1Qgmrx70AYppweXztN8b0VA.png)\nFederico Trotta\nHi, I'm Federico Trotta and I'm a freelance Technical Writer.\nWant to collaborate with me? [Contact me](https://bio.link/federicotrotta).\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657183787_vf5bj8.png)\nWritten By\n## [Federico Trotta](https://towardsdatascience.com/author/federicotrotta/)\n[See all from Federico Trotta](https://towardsdatascience.com/author/federicotrotta/)\n[Artificial Intelligence](https://towardsdatascience.com/tag/artificial-intelligence/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Federico Trotta](https://towardsdatascience.com/tag/federico-trotta/)[Machine Learning](https://towardsdatascience.com/tag/machine-learning/)[Technology](https://towardsdatascience.com/tag/technology/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fa-gentle-introduction-to-generative-ai-for-beginners-8c8752085900%2F&title=A%20Gentle%20Introduction%20To%20Generative%20AI%20For%20Beginners)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fa-gentle-introduction-to-generative-ai-for-beginners-8c8752085900%2F&title=A%20Gentle%20Introduction%20To%20Generative%20AI%20For%20Beginners)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fa-gentle-introduction-to-generative-ai-for-beginners-8c8752085900%2F&text=A%20Gentle%20Introduction%20To%20Generative%20AI%20For%20Beginners)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2025/04/jr-korpa-SgG6o7wDzd0-unsplash-scaled-1.jpg)](https://towardsdatascience.com/the-art-of-noise/)\n## [Diffusion Model Paper Walkthrough: The Art of Noise](https://towardsdatascience.com/the-art-of-noise/)\n[Deep Learning](https://towardsdatascience.com/category/artificial-intelligence/deep-learning/)\nUnderstanding and implementing a diffusion model from scratch with PyTorch\n[Muhammad Ardi Putra](https://towardsdatascience.com/author/muhammad_ardi/)\nApril 2, 202533 min read\n  * [![](https://towardsdatascience.com/images/fallback-image.jpg)](https://towardsdatascience.com/handling-time-zones-with-python-a100bfc7f6df/)\n## [Handling Time Zones with Python](https://towardsdatascience.com/handling-time-zones-with-python-a100bfc7f6df/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nThis post demonstrates the functionalities to deal with time zones in Python\n[Himalaya Bir Shrestha](https://towardsdatascience.com/author/himalaya.birshrestha/)\nApril 21, 202310 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2025/01/1f0PkshYadnjBu0el57GX7Q.jpeg)](https://towardsdatascience.com/learn-to-build-agentic-ai-systems-9e552d841525/)\n## [On a Time Crunch but Still Want to Learn to Develop Multi-Agent AI?](https://towardsdatascience.com/learn-to-build-agentic-ai-systems-9e552d841525/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nThese 3 starter projects only take a weekend (and a few cups of coffee, maybe)\n[Thuwarakesh Murallie](https://towardsdatascience.com/author/thuwarakesh/)\nJanuary 23, 202513 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/1H1SYtTUhZsRGOAsZYFgbSw-scaled.jpeg)](https://towardsdatascience.com/how-you-can-build-simple-recommender-systems-with-surprise-b0d32a8e4802/)\n## [How you can build simple recommender systems with Surprise.](https://towardsdatascience.com/how-you-can-build-simple-recommender-systems-with-surprise-b0d32a8e4802/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nUsing this Python library to build a book recommendation system.\n[Amol Mavuduru](https://towardsdatascience.com/author/amolmavuduru/)\nDecember 24, 20208 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/02/1vJG7O2ua2Eba61EXKGymkg.png)](https://towardsdatascience.com/naive-bayes-classifier-explained-50f9723571ed/)\n## [Naive Bayes Classifier - Explained](https://towardsdatascience.com/naive-bayes-classifier-explained-50f9723571ed/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nTheory and implementation with scikit-learn\n[Soner Yıldırım](https://towardsdatascience.com/author/sonery/)\nFebruary 14, 20206 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2026/02/1-1-1.jpeg)](https://towardsdatascience.com/optimizing-token-generation-in-pytorch-decoder-models/)\n## [Optimizing Token Generation in PyTorch Decoder Models](https://towardsdatascience.com/optimizing-token-generation-in-pytorch-decoder-models/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nHiding host-device synchronization via CUDA stream interleaving\n[Chaim Rand](https://towardsdatascience.com/author/chaimrand/)\nFebruary 24, 202615 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/04/0Th0kSqxgWXhWvIdT-scaled.jpg)](https://towardsdatascience.com/7-ways-to-improve-performance-of-your-data-warehouse-4544456bcc3/)\n## [7 Ways to Improve Performance of Your Data Warehouse](https://towardsdatascience.com/7-ways-to-improve-performance-of-your-data-warehouse-4544456bcc3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nImprove Poor Performance of Your Data Warehouse by Applying These Steps\n[Hanzala Qureshi](https://towardsdatascience.com/author/hanzalaqureshi/)\nApril 26, 20226 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2026/04/image-1.jpeg)](https://towardsdatascience.com/the-llm-gamble/)\n## [The LLM Gamble](https://towardsdatascience.com/the-llm-gamble/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nWhy it tickles your brain to use an LLM, and what that means for the AI industry\n[Stephanie Kirmer](https://towardsdatascience.com/author/s.kirmer/)\nApril 20, 20267 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/04/0z3YQGPUlKdpoQk0X-scaled.jpg)](https://towardsdatascience.com/one-mindset-shift-that-will-make-you-a-better-data-scientist-a015f8000ad7/)\n## [One Mindset Shift That Will Make You a Better Data Scientist](https://towardsdatascience.com/one-mindset-shift-that-will-make-you-a-better-data-scientist-a015f8000ad7/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nActually, any good employee should adopt this mindset\n[Tessa Xie](https://towardsdatascience.com/author/tessaxie/)\nApril 15, 20246 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3642/image?etag=1780830904480&width=500&height=500) Check Your Biases ](https://towardsdatascience.com/check-your-biases-ba2685a7f799/ \"Check Your Biases\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4973/image?etag=1782232567105&width=500&height=500) Machine Learning Tricks, Learning with ChatGPT, and Other Recent Must-Reads ](https://towardsdatascience.com/machine-learning-tricks-learning-with-chatgpt-and-other-recent-must-reads-f277648a1921/ \"Machine Learning Tricks, Learning with ChatGPT, and Other Recent Must-Reads\")\n\n\nword word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word\n  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1\n",
  "metadata": {
    "title": "A Gentle Introduction To Generative AI For Beginners | Towards Data Science",
    "description": "Let's understand the big picture behind generative AI",
    "keywords": null,
    "author": "Federico Trotta",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "A Gentle Introduction To Generative AI For Beginners",
    "og:description": "Let's understand the big picture behind generative AI",
    "og:url": "https://towardsdatascience.com/a-gentle-introduction-to-generative-ai-for-beginners-8c8752085900/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1M5-j-eOyAEFHvLlVgblF-Q.jpeg",
    "og:image:width": "1280",
    "og:image:height": "1280",
    "og:image:type": "image/jpeg",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Federico Trotta",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "9 min read",
    "article:published_time": "2023-06-29T02:40:27.000Z",
    "article:modified_time": "2023-06-29T02:40:27.000Z",
    "article:author": "https://towardsdatascience.com/author/federicotrotta/"
  },
  "paywall": {
    "listed_paid": true,
    "detected": false,
    "marker": "",
    "public_only": true,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": "",
    "retried": true
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/6938a5a35a24/code/block_000.txt",
      "chars": 124
    }
  ],
  "images": [
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1M5-j-eOyAEFHvLlVgblF-Q.jpeg",
      "alt": "Image by Susan Cipriano on Pixabay",
      "local_path": "attachments/6938a5a35a24/images/000.jpeg",
      "bytes": 134380,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1JNe9M643THS5PdL2sqwLAw.png",
      "alt": "The process behind traditional AI. Image by Author.",
      "local_path": "attachments/6938a5a35a24/images/001.png",
      "bytes": 106441,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1r5aKRUTycNESMYfxxvLUkQ.png",
      "alt": "The process behind generative AI. Image by Author.",
      "local_path": "attachments/6938a5a35a24/images/002.png",
      "bytes": 100905,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/07/1Qgmrx70AYppweXztN8b0VA.png",
      "alt": "Federico Trotta",
      "local_path": "attachments/6938a5a35a24/images/003.png",
      "bytes": 321502,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2025/04/jr-korpa-SgG6o7wDzd0-unsplash-scaled-1.jpg",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/004.jpg",
      "bytes": 559290,
      "downloaded": true
    },
    {
      "src": "/images/fallback-image.jpg",
      "alt": "",
      "local_path": "",
      "bytes": 0,
      "downloaded": false
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2025/01/1f0PkshYadnjBu0el57GX7Q.jpeg",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/006.jpeg",
      "bytes": 157878,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/1H1SYtTUhZsRGOAsZYFgbSw-scaled.jpeg",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/007.jpeg",
      "bytes": 435542,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/02/1vJG7O2ua2Eba61EXKGymkg.png",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/008.png",
      "bytes": 3145,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2026/02/1-1-1.jpeg",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/009.jpeg",
      "bytes": 357016,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2022/04/0Th0kSqxgWXhWvIdT-scaled.jpg",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/010.jpg",
      "bytes": 712538,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2026/04/image-1.jpeg",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/011.jpeg",
      "bytes": 134061,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2024/04/0z3YQGPUlKdpoQk0X-scaled.jpg",
      "alt": "",
      "local_path": "attachments/6938a5a35a24/images/012.jpg",
      "bytes": 524491,
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [],
  "retry_at": "2026-10-03T08:01:37",
  "repair_version": 2,
  "repaired_at": "2026-10-14T11:11:49Z",
  "source_url": "https://towardsdatascience.com/a-gentle-introduction-to-generative-ai-for-beginners-8c8752085900/",
  "delivery_status": "excluded_paid",
  "discovery_status": "excluded_paid",
  "missing_reason": "按原约定排除付费/会员全文"
}