AI Large Models for Absolute Beginners: Principles and API Calling in Practice

From the evolution of AI to hands-on API practice, a complete path to large model calls for absolute beginners.
Based on a hands-on course for beginners, this article maps the full path from AI's evolution to large model API calls: it reviews the shift from expert systems to trillion-parameter models, breaks down three-stage training, explains tokens and the Temperature/Top-P parameters, analyzes web search, RAG, and memory, and walks through four DashScope scenarios—basic chat, Function Call, vision table extraction, and ops alerts—with practical engineering tips.
Large models are no longer a concept confined to laboratories—they are tools developers can readily use in their daily work. But for learners starting from zero, three barriers stand between "having heard of it" and "getting your first API call to work": understanding the principles, configuring the environment, and grasping the parameters. Based on a hands-on course aimed at beginners, this article lays out the complete path from the evolution of AI to putting large model calls into practice, helping you build an actionable mental framework in the shortest possible time.
From Expert Systems to Large Models: The Logic of AI Capability Transfer
To understand why large models are so powerful, you first need to see the main thread of AI's development: machines have gradually shifted from relying on human experience to autonomously finding patterns in data.
The Rule-Based Era: Human Experience Becomes the Bottleneck
Early AI was represented by expert systems. Back in the 1970s, people already attempted autonomous driving by hard-coding rules like "brake at a red light, yield when turning right" into programs. The problem: the completeness of rules depended on humans exhaustively enumerating their experience, and the system was helpless when confronted with unexpected situations. A frequently cited analogy: if a car drove solely on preset rules, would you dare ride in it?
The defining characteristic of this stage was "humans set the rules for machines," and the machine's autonomy was extremely limited.
Machine Learning and Deep Learning: Parameter Counts Begin to Swell
Machine learning let machines find patterns in data. Starting with parameter counts in the dozens or hundreds, it could handle tasks like house price prediction. With deep learning introducing neural networks, network layers deepened and parameter counts reached tens of thousands to millions—enough to support complex tasks like recommendation systems and image recognition.
By the large model stage, parameter counts leaped to the trillion level. The course uses K2 as an example: roughly 1TB of parameters, which can be understood as over a trillion. For reference, the human brain has about 250 trillion neurons—from this perspective, the human brain remains the largest "model."
Analytical vs. Generative: The Divide Between Task Types
AI tasks can be broadly divided into two categories. Analytical tasks center on decision-making; in the past, algorithm engineers mostly did this kind of work, training models on proprietary small-scale data to solve specific problems. Generative tasks point toward creative work—writing, drawing, audio, video—and are highly diverse in task type. The spread of large models essentially pushed AI from a "decision-making tool" to a "productivity tool."
How Large Models Are Made: Breaking Down Three-Stage Training
The course uses the analogy of "teaching a child to recognize a banana" to explain the training process plainly, and this path corresponds to the three stages recognized across the industry.
Supervised Learning: From 0 to 60 in a Crash Course
The first stage is supervised learning, essentially "force-feeding" memorization. Humans organize corpora and feed them to the machine, just as a teacher directly tells a child "a banana is a plant in the Musaceae family." This method learns extremely fast and lets the model quickly establish basic concepts about the world, but its drawback is inflexibility—it struggles to infer when faced with new problems it hasn't memorized.
Take GPT-3.5 as an example: training used 45TB of corpus. The course offers an intuitive conversion: 1TB of corpus is roughly equivalent to 10 million books, while an adult reads at most 1,000 books from age 0 to 20. The gap in breadth of knowledge is orders of magnitude.
The word "supervised" in supervised learning refers to training data carrying labels. Take sentiment analysis: each piece of corpus is pre-labeled "positive" or "negative," and the model adjusts its parameters by continuously predicting and comparing against the labels—essentially minimizing the error between predicted values and true labels. The "next-word prediction" used in the pretraining stage of large models is also a variant of self-supervised learning—the label is hidden in the text itself, requiring no manual annotation, which is precisely why corpora at the scale of 45TB can be used. This also explains why the first stage can quickly build broad world knowledge yet struggles to ensure outputs align with human preferences: it learns "what text looks like," not "which answer is better."
Reinforcement Learning and Reward Models: Letting AI Do the Work Itself
The second stage introduces reinforcement learning. The machine generates multiple answers to the same question, and humans are only responsible for ranking and scoring them, indicating which is better. The course draws an analogy to the workplace: would a leader rather finish the work themselves and have subordinates copy it, or have subordinates draft several versions first and then comment on them? The latter is obviously more sustainable—reinforcement learning gives AI the initiative in its work while humans step back into the role of "evaluator."
This evaluation mechanism corresponds to the Reward Model. The course mentions that OpenAI early on hired Kenyan employees for annotation at $2 an hour, all fluent in English. Initially a scoring system was used, but when different annotators gave 0.5 and 1 point for the same answer, the model became confused by inconsistent standards. Later this was changed to a ranking method (Rank List), where annotators judge whether A is better than B, making standards more consistent. The ranking mechanism has an added benefit: harmful information gets ranked to the back, while better new answers can be ranked to the front—both blocking bad content and encouraging innovation.
The Reward Model itself is an independent neural network whose training objective is to fit human preference judgments. Specifically: for the same question, the model generates two answers A and B, and human annotators only need to indicate which is better; the reward model then learns "given a question and an answer, output a score" such that more-preferred answers score higher. Once trained, this reward model can replace humans to quickly score any newly generated answer. What the industry commonly calls RLHF (Reinforcement Learning from Human Feedback) includes this step: first train a reward model on human preferences, then use reinforcement learning algorithms (such as PPO) to optimize the language model toward the direction where the reward model gives high scores. The reason ranking beats scoring is that humans are more consistent when making relative comparisons than when giving absolute scores, resulting in less noise.
Generalized Creation: Scoring New Answers with the Reward Model
The third stage deals with new tasks that never appeared in training, such as writing an entirely new story. After the model generates multiple versions, the reward model trained in the second stage scores and ranks them, selecting the answer users are most likely to be satisfied with. This process gives large models the ability to handle open-ended tasks.
Tokens and Generation Parameters: The Units of Measurement in the Large Model World
Tokens: Text as Machines See It
Large models don't process human text directly; they first perform tokenization, splitting text into tokens. Take GPT: the two words "Hello World" correspond to two tokens, each with its own ID. Case affects token IDs, and Chinese tokenization isn't split by individual characters either—in the course demo, when "人工智能你好啊" is input, DeepSeekAd splits it into three tokens: "人工智能," "你好," and "啊." Different models maintain their own vocabularies; LLaMA's token count is around 30,000+, while other models reach 70,000+.
Besides regular tokens, special delimiters serve structural marking functions: user identifies user input, assistant identifies model replies, and BOS and EOS mark sentence start and end respectively. These symbols have no actual semantics, yet they let the model determine conversation turns and paragraph boundaries.

Temperature and Top-P: Two Knobs for Controlling Creativity
Temperature controls output style by adjusting the probability distribution. Raising the temperature (e.g., to 1.0) activates low-probability words, producing more creative but potentially less logical output; lowering it (e.g., below 0.3) lets high-probability tokens perform steadily, making results more controllable.
Top-P takes another route: accumulate from high to low probability, stop when reaching a set threshold P, and randomly select only within the candidate set. The course uses "今天天气真___" (the weather today is really ___) as an example: "真好" (really good) has 60% probability, "真不错" (really nice) next, and "真可乐" (really cola) only 0.01%. Setting P=0.9 keeps only "真好" and "真不错" in the candidate set, and low-probability options like "可乐" are filtered out directly.
The difference between the two: Temperature acts on the entire probability distribution and in theory still preserves the possibility of extremely low-probability events; Top-P filters first and then samples, more effectively blocking absurd answers. The course's view is that Top-P is more effective for generating high-quality text. The two can also be used together.

The Three Superpowers of AI Products: Web Search, File Reading, and Memory
AI products on the market can search the web, accept uploaded files, and remember preferences because of the design behind three capabilities.
Web Search and Function Call
Large models' training data has a cutoff date and cannot answer "what time is it now" or "what's today's date." Web search relies on the Function Call mechanism: after the system identifies a request needing external information, it automatically invokes a search tool, extracts keywords from the user's question to pass to the search engine, then organizes the retrieval results into the answer. This "parameter extraction" step tests the model's extraction ability; when extraction quality is poor, fine-tuning can improve it.
File Reading and RAG
Enterprise internal knowledge base scenarios typically follow the RAG route. After documents are uploaded, they are split into chunks and converted into vectors stored in a vector database. When a user asks a question, the question is likewise converted into a vector, the closest text chunks are retrieved as context, and they are fed into the model together with the question to generate an answer. The course mentions that Chunk Size requires trade-offs: documents with strong content coherence can use larger sizes, while fragmented knowledge should use smaller ones; in Alibaba's internal Qwen scenarios, around 500 is used as a reference value.

A vector database is the retrieval core of the RAG pipeline. A "vector" refers to mapping a piece of text into a high-dimensional numerical array using an embedding model; texts with similar semantics are closer in vector space. When a user asks a question, the system likewise converts the question into a vector and finds the closest text chunks in the database using measures such as cosine similarity. The key here is that retrieval is based on semantic similarity rather than keyword matching, so "reimbursement process" can recall content phrased differently, like "expense application steps." Chunk Size requires trade-offs because when chunks are too large, a single vector mixes multiple topics and reduces retrieval precision; when chunks are too small, context is fragmented and the model struggles to answer completely from the fragments. A common practice is to set some overlap so that key information isn't cut off exactly at a boundary.
Short-Term and Long-Term Memory
Large models themselves are stateless—every conversation starts from zero, which the course compares to a goldfish's 7-second memory. Short-term memory works by compressing previous conversation turns and stuffing them into the context window. Long-term memory goes further, storing user profiles, preferences, and answer styles in a dedicated database so the model keeps "understanding you" in subsequent interactions. The course mentions that DeepSeek's long-term memory is not yet complete, while ChatGPT has already begun implementing this capability. For institutional clients such as banks, the value of user profiles is of particular interest.
Hands-On Practice: Four API Calling Scenarios
The latter half of the course completes four examples using the DashScope tool on Alibaba Cloud's Model Studio platform.
Scenario 1: Basic Conversation and System Prompts
The first example does sentiment analysis: system sets the model to play the role of a public opinion analyst, user provides a product review, and assistant returns a positive/negative judgment. These three roles form the basic skeleton of a conversation. Swap the system prompt for "You are an excellent copywriter," and the same model can output promotional copy—the system prompt defines the persona and is the role foundation of the entire application. Multi-turn conversations are assembled by appending user and assistant content in sequence to the message list.
Scenario 2: Function Call to Invoke a Weather Tool
When asked "How's the weather in Dalian," the model's training data contains no real-time weather. In the code, tool functions (name, description) are registered via a dictionary; the model determines a call is needed and returns a function call instruction, the tool is executed to obtain the result, and the model then synthesizes it into a natural-language reply. Note that this scenario requires choosing a model that supports Function Call—in the course demo, the model had to be switched to Qwen Max for it to work smoothly.
The working mechanism of Function Call (also called Tool Calling) can be broken into three steps. The first step is "declaration": the developer sends the available tools' names, function descriptions, and parameter structures (usually JSON Schema) to the model along with the request. The second step is "decision": the model judges from the user's question whether a tool needs to be called, which one, and what parameters to fill in, then returns a structured call instruction rather than replying with text directly. The third step is "write-back": the developer executes the function locally, appends the returned result to the conversation under a specific role (such as tool), and requests the model to generate the final answer. The model itself executes no code—it only "decides what to call and what parameters to pass," and actual execution happens in your program, which is why tool security remains in the developer's hands. The model's understanding of tool descriptions directly determines call accuracy, so descriptions should clearly state the purpose and meanings of parameters.
Scenario 3: Extracting Tables with a Vision Large Model
Calling Qwen VL (Vision Large Model) handles image question answering. By passing an image link and extraction requirements and specifying JSON output format, the model can extract table contents. This opens the door to mixed image-text scenarios.
Scenario 4: Handling Ops Alerts
Simulating a real business scenario: when database connections exceed a threshold and trigger an alert, the model plays the role of an operations analyst, calls tools to obtain system metrics such as connection count, CPU usage, and memory usage, and synthesizes them into fault diagnosis recommendations. This case demonstrates how the combination of "model reasoning + tool execution" lands in enterprise processes.

Model Selection and Engineering Practice Recommendations
In the model landscape shown in the course, overseas players are represented by OpenAI, Gemini, and Claude, while domestic ones include Qwen, DeepSeek, Kimi, and others. Enterprise selection also involves IT security review: foreign companies often prohibit overseas models with high open permissions, while domestic companies tend to favor domestic models or private deployment.
Practical advice for beginners can be summarized as the "four swaps": swap the API, swap the scenario, swap the model, swap the tool. Beginners should first get the course examples working, while experienced learners can replace task types based on their work scenarios, switch interfaces from different vendors, and try small local models (such as Qwen 3's 4B).
API Key management should avoid hard-coding; writing to environment variables or a separate .env file is recommended. Environment configuration errors are normal in the early learning stage—if a package is missing, just pip install it; if it's slow, add the Tsinghua mirror source. The principle the course repeatedly emphasizes: solve problems when they arise, and don't worry in advance about every possible issue. Getting it working is the top priority; rewriting and optimization can proceed step by step.
One-line Summary
From the evolution of AI to hands-on API practice, this lays out the complete path to putting large model calls into action for absolute beginners.
Paragraph Summary
Based on a hands-on course for beginners, this article systematically lays out the complete path from the evolution of AI to large model API calls. It first reviews AI's main line of development from expert systems, machine learning, and deep learning to large models, noting that parameter counts grew from dozens to the trillion level—essentially a transfer of capability from humans to machines. It then uses the analogy of "teaching a child to recognize a banana" to break down the three-stage training process of supervised learning, reinforcement learning with reward models, and generalized creation. Next, it explains the tokenization mechanism and the difference between the two generation parameters Temperature and Top-P, and analyzes the technical implementation of three product capabilities: web search, RAG file reading, and short- and long-term memory. Finally, it completes four hands-on scenarios via Alibaba Cloud's Model Studio DashScope—basic conversation, Function Call, vision-based table extraction, and ops alert handling—and offers "four swaps" advancement advice along with engineering practice points such as API Key management and environment configuration.
Related articles

A New Paradigm for Text Editing in Compose: TextFieldState Replaces the Old API
Jetpack Compose introduces the TextFieldState API to fix dropped characters and cursor jumps from async input. The old value/onValueChange callbacks will be deprecated in 1.13. This article covers InputTransformation, OutputTransformation, four state hoisting patterns, and new formatted text editing capabilities.

Remote Compose: A New Document-Driven Paradigm for Cross-Platform UI on Android
Remote Compose transmits compact binary documents instead of screen pixels, enabling efficient UI rendering on remote surfaces like Wear OS and widgets. This article covers its document creation API, expression animations, size optimization techniques, and Wear OS progress.

How Crashlytics Eliminates Android Memory and Responsiveness Issues
Through the Chroma Clip case study, this article explains how Firebase Crashlytics uses Application Exit Info, Profiling Manager, GWP ASAN, and ARM MTE to pinpoint ANRs, OOMs, memory limit terminations, and native memory corruption—solving the challenge of stack traces that don't point to the real culprit.