<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Karan R Singh</title>
    <description>The latest articles on DEV Community by Karan R Singh (@karanrsingh).</description>
    <link>https://dev.to/karanrsingh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1088367%2Fcdd9bc08-7610-46ad-a285-2628ffdb8756.jpg</url>
      <title>DEV Community: Karan R Singh</title>
      <link>https://dev.to/karanrsingh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karanrsingh"/>
    <language>en</language>
    <item>
      <title>How ChatGPT and other LLMs work - A 1000 ft view</title>
      <dc:creator>Karan R Singh</dc:creator>
      <pubDate>Sun, 21 Jul 2024 14:57:02 +0000</pubDate>
      <link>https://dev.to/karanrsingh/how-chatgpt-and-other-llms-work-a-1000-ft-view-2dg6</link>
      <guid>https://dev.to/karanrsingh/how-chatgpt-and-other-llms-work-a-1000-ft-view-2dg6</guid>
      <description>&lt;p&gt;Hi, I am Karan back with a new article on How ChatGPT and other LLMs work, this article will give you a very high level understanding of how this all works not going too deep in concepts today, because i am also learning all this and this is a way to document my learnings through out my journey, there will be series of articles in future on this topic in which I will go deep on many concepts related to AI and ML.&lt;/p&gt;

&lt;p&gt;Let's start with basics, what actually AI is and where do ChatGPT like LLMs fall into. So, AI is short for Artificial Intelligence which is a field of computer science which focuses on creating systems to perform tasks that usually requires human intelligence. AI is not new it is there for decades with Machine Learning and Computer Vision, used in recommendations, search engines, classifications etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkl3c0kmlvuqm16j4wse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkl3c0kmlvuqm16j4wse.png" alt="AI doodle" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nowadays, the hot topic in AI is GenAI or Generative AI which generates new content rather than finding or classifying existing content. GenAI contains text gen, image gen, audio gen, video gen etc. Yes, the G in GPT refers to Generative. &lt;br&gt;
The AI which mainly deals with text gen is called as LLM short for Large Language Model. ChatGPT is one of the LLMs in the internet you may had used, there are also others like Google Bard, Anthropic Claude, etc. Today we will have a high level look into LLMs.&lt;br&gt;
So, LLMs consist of three things, we can show it as &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;LLM = data + architecture + training&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Let's assume we are creating a ChatGPT grade LLM named Chiti, we will go step by step&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Data - Chiti Knowledge Source💡
&lt;/h3&gt;

&lt;p&gt;first we need a massive amount of Text Data for eg. ChatGPT was &lt;strong&gt;Pre-trained&lt;/strong&gt; (P in GPT) on &lt;strong&gt;570GB (1gb ≈ 178m words)&lt;/strong&gt; of text data, a good chunk of internet. Pre-trained means to initially train a model with large corpus of general data before being fine-tuned or adapted for specific tasks. Pre-training helps the model to learn language patterns, grammar, facts, and some level of reasoning.&lt;/p&gt;

&lt;p&gt;Let's say we collected sufficient data by extracting content from the websites, articles, books, etc. and our dataset is ready. Now, comes the most important part creating a Architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Architecture - Chiti Brain 🧠.
&lt;/h3&gt;

&lt;p&gt;Here comes the concept of Neural Networks, its like neurons in a human brain. It helps LLMs to understand, learn and respond. When we talk about training a model we talk about training the NN. NN do not understand text, thus we have to convert the data, first in tokens(words or subwords) and then in Embeddings(numbers) this process is called as Encoding (It includes more things), then the encoded data is fed to NN and the response which we get is decoded and showed as response.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfvqn5c07o0rw2439jn9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfvqn5c07o0rw2439jn9.png" alt="Neural Network" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are various types of NNs which have their own purpose. In Modern LLMs we use &lt;strong&gt;Transformers&lt;/strong&gt;(T in GPT), It is a very core and complex concept in LLM, my next article will be on explaining transformers.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Training - Chiti Education 🏫.
&lt;/h3&gt;

&lt;p&gt;Model training is the most crucial and expensive part of LLM development, it marks the quality in a LLMs response. In this part we splits our dataset which we have created in first step in two parts (90%-10%), one part for training and second for testing, the training data will contain input and answer both for eg. Input: Tajmahal is in and Answer: Agra. So that the Transformer NN can learn and understand patterns and assign weights and biases to each params in NN (will explain in next article). &lt;br&gt;
Note: the training data is encoded before sending to Transformer NN.&lt;/p&gt;

&lt;p&gt;After training is completed, our LLM Chiti will be tested with the test data.&lt;/p&gt;

&lt;p&gt;This was the very sky level view of how LLMs work and created, trust me there are many concepts here which i do not mention like Tensors, back propagation, position encodings, layers, etc. I will learn and explain all this in future. If you have any questions do let me know.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Neural Networks require a good maths understanding specially Matrices, so if you are in college, please don't bunk maths lecture.&lt;/p&gt;

&lt;p&gt;Thank You,&lt;br&gt;
Karan R Singh&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Who &amp; What is behind the magic of tech world</title>
      <dc:creator>Karan R Singh</dc:creator>
      <pubDate>Tue, 09 Jul 2024 11:51:02 +0000</pubDate>
      <link>https://dev.to/karanrsingh/who-what-is-behind-the-magic-of-tech-world-3l71</link>
      <guid>https://dev.to/karanrsingh/who-what-is-behind-the-magic-of-tech-world-3l71</guid>
      <description>&lt;p&gt;Ganpati Bappa Morya 🙏&lt;/p&gt;

&lt;p&gt;Hi, this is me with my first article, which will explain you how the industry of the most prominent sector of the world looks like, who works behind the screens of your most used app or site or game, how the development process works and much more. Let's Start.&lt;/p&gt;

&lt;p&gt;I am taking example of Instagram, below is the whole system design of Instagram&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx6p7o08ewahjlsk2o1o4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx6p7o08ewahjlsk2o1o4.png" alt="Instagram System Design Image" width="800" height="644"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A system design is a design of the backend architecture of a tech product, the design should be reliable and scalable to handle projected users (unlike our government websites), usually it is done by seniour software engineers in the company, but it is a crucial part in development so everyone should know about this. &lt;/p&gt;

&lt;p&gt;let's slowly breakdown the design. In every tech product three things are permanent and everything else are just the branches. Hence, the design can be devided into Client (Frontend), Server (Backend) and Database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwom1k27d0qis6949lzh5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwom1k27d0qis6949lzh5.png" alt="csd" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Instagram design you can see the first Icon named users it is called client or frontend from which we normal consumer interacts and been devotees of. Instagram have two clients one its APP and other is WEBSITE.&lt;/p&gt;

&lt;p&gt;The people who make Apps are called as &lt;strong&gt;App developers&lt;/strong&gt; or more specificaly Android developers or IOS developers and this branch of IT is called Android development.&lt;/p&gt;

&lt;p&gt;To be a App developer here are the tech stack you will require,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Android Dev

&lt;ul&gt;
&lt;li&gt;Kotlin or Java (recommended Kotlin)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;IOS Dev

&lt;ul&gt;
&lt;li&gt;Swift &lt;/li&gt;
&lt;li&gt;And a Mac device to develop IOS apps&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A third type also exists in which we can make apps for both through one codebase and tech stack&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cross Platform Dev

&lt;ul&gt;
&lt;li&gt;React Native (Insta uses this)&lt;/li&gt;
&lt;li&gt;Flutter (recommended if you are starting out)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: A App developer should know the fundamentals of server and database also in order to build app and connect them to architecture smoothly, this all three are interconnected &lt;/p&gt;

&lt;p&gt;Now, the people who develop Websites is called as &lt;strong&gt;Web developers&lt;/strong&gt; more specificaly Frontend Web Developer and the field is called as Frontend Web Development.&lt;br&gt;
The Fundamentals which is required to do Frontend Web Development is&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;Javascript &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;the above is Important and should not be ignored, but this is not enough to be hired as FW dev, you need to learn the frameworks of javascript in order to make a site which is more value providing than the plain javascript&lt;/p&gt;

&lt;p&gt;the top frameworks are for job market:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React JS (Recommended)&lt;/li&gt;
&lt;li&gt;Vue JS&lt;/li&gt;
&lt;li&gt;Angular JS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here the Job market splits into respective frameworks, like React Developer, Vue Developer, Angular Developer etc. React has more demand in the market.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: In order to learn the framework you should have a good amount of knowledge in javascript&lt;/p&gt;

&lt;p&gt;If you had choosen to learn react i will suggest you to must learn &lt;strong&gt;Nextjs&lt;/strong&gt; which is the superset of react and it enables you to stand in the global market.&lt;/p&gt;

&lt;p&gt;The above was the frontend world of app and web, there is a world also exists for pc apps but it is a topic for an another day.&lt;/p&gt;

&lt;p&gt;Now after the user icon you can see various things, here the actual business logic is written down this is called server or backend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I found a goldmine video on youtube which will explain backend like no one could, watch now 👇&lt;/strong&gt;&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://www.youtube.com/watch?si=_ihLguVAmG2F0NL6&amp;amp;v=XBu54nfzxAQ&amp;amp;feature=youtu.be" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--RdL7vJhl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.ytimg.com/vi/XBu54nfzxAQ/maxresdefault.jpg" height="450" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://www.youtube.com/watch?si=_ihLguVAmG2F0NL6&amp;amp;v=XBu54nfzxAQ&amp;amp;feature=youtu.be" rel="noopener noreferrer" class="c-link"&gt;
          Backend web development - a complete overview - YouTube
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          We learn every backend technology we need to build a web application. We go over backend programming languages, backend web frameworks, databases, APIs, REST...
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--Oyr-jiM3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.youtube.com/s/desktop/a2763344/img/favicon.ico" width="16" height="16"&gt;
        youtube.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Backend is really very vast.&lt;/p&gt;

&lt;p&gt;Now, the person who knows frontend and backend and able to make product from start to finish, from development to deployment is known as Full Stack Developer and yes I am a Full Stack Developer (&lt;a href="https://itskaransingh.vercel.app/" rel="noopener noreferrer"&gt;my portfolio&lt;/a&gt;), but how do i learned all this without spending a peny? the answer is youtube. But youtube is scatered, right? So, i will tell you how do i learned all this and what is the thaught process behind while learning a new tech.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Whichever thing you are learning first know the path, watch roadmap videos of the choosen topic from youtube&lt;/li&gt;
&lt;li&gt;Watch youtube tutorials which are project building oriented not theory based for specified topic in the roadmap&lt;/li&gt;
&lt;li&gt;Code along with the tutorial, its okay to make initial projects by watching tutorials (max 2).&lt;/li&gt;
&lt;li&gt;Try to build something yourself, feel the feeling of being a creator.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So yes this was my approach towards learning from a scatterd platform, but believe we can do anything, build anything, be anything, if we know something that can be implemented in everything.&lt;/p&gt;

&lt;p&gt;Please give me the feedback and suggest me the next topic for the article,&lt;br&gt;
Thank you for reading,&lt;br&gt;
&lt;strong&gt;♠️ Karan R Singh&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>computerscience</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
