Machine Learning

Ukudlula Iwindi Lokuqukethwe: Amamodeli Olimi Aphindaphindayo Asesenzweni

umongo uyikho konke ngempela. Izinga lokuphumayo kwe-LLM lixhunywe ngokuqinile kwikhwalithi nenani lolwazi olunikezayo. Empeleni, izimo eziningi zokusetshenziswa komhlaba wangempela ziza nezimo ezinkulu: ukukhiqizwa kwekhodi ngezisekelo ezinkulu zekhodi, ukubuza ngezinhlelo zolwazi eziyinkimbinkimbi, noma izingxoxo ezinde, eziyaluza ngenkathi sicwaninga indawo ekahle yeholide (sonke sike saba khona).

Ngeshwa, ama-LLM angasebenza kahle kuphela ngenani elilinganiselwe lomongo. Futhi lokhu akukhona nje ngemikhawulo eqinile yefasitela lomongo, ikakhulukazi manje lapho amamodeli asemngceleni asekela amakhulu ezinkulungwane, noma izigidi, zamathokheni. Futhi leyo mikhawulo iyaqhubeka nokukhula. Inselele enkulu yinto eyaziwa ngokuthi ukubola kokuqukethwelapho ukusebenza kwemodeli kwehla njengoba ubude bomongo bukhula.

Lo mphumela uboniswe ngokucacile ephepheni elithi “RULER: Buyini Ubukhulu Bangempela Bomongo Wezinhlobo Zakho Zolimi Olunengqikithi Emide?” nguHsieh et al. Ababhali bethula i-RULER, ibhentshimark entsha yokuhlola ukusebenza kokuqukethwe okude, futhi bahlole izinhlobonhlobo zamamodeli. Imiphumela ibonisa iphethini engaguquki: njengoba ubude bomongo bukhula, ukusebenza kwehla kakhulu kuwo wonke amamodeli. Ezimweni eziningi, ubude bomongo obusebenzayo (lapho ukusebenza kuhlala kuqhathaniswa ne-Llama 2–7B) cishe kungama-50% kuphela wewindi lokuqukethwe elikhangisiwe, noma ngaphansi.

Umfanekiso ovela ephepheni u-Hsieh et al, 2024 | umthombo

Ephepheni labo lakamuva “Amamodeli Olimi Aphindaphindayo”, UZhang et al. phakamisa indlela ethembisayo yokubhekana nenkinga yokubola kwengqikithi. Kulesi sihloko, ngingathanda ukubhekisisa lo mbono futhi ngihlole ukuthi usebenza kanjani ekusebenzeni, ngisebenzisa ukusekelwa okusanda kwengezwa kwe-DSPy kwaleli su lokucabanga.

Amamodeli Olimi Aphindaphindayo

Amamodeli Olimi Oluphindaphindayo (ama-RLM) aqaliswa ukuze kubhekwane nokwehliswa kokusebenza njengoba ubude bomongo bukhula, kanye nokwenza ama-LLM asebenze ngezimo ezinkulu kakhulu (kufika kuma-oda amabili obukhulu ngale kwewindi lomongo lomdabu wemodeli). Lokhu kubaluleka kakhulu njengoba sisebenzisa ama-LLM emisebenzini ehilela ukucubungula amakhulu ezigidi zamathokheni.

Sekuvele kunezindlela ezimbalwa zokuphatha imisebenzi yomkhathizwe omude. Okuvame kakhulu (into okungenzeka ukuthi uhlangabezane nayo lapho usebenzisa ama-code agents afana ne-Cursor) yile isifinyezo somongo. Kulokhu kusetha, ingxoxo noma umongo wokusebenza ufingqwa ngokuphindaphindiwe uma ususondele emkhawulweni womongo wemodeli. Kodwa-ke, ekusebenzeni, lokhu kuvame ukuwela: imininingwane ebalulekile kanye nama-nuances acashile kusuka ezinyathelweni zangaphambili kuvame ukulahleka njengoba imodeli “ikhohlwa” ulwazi oludala ukuze yenze indawo yamathokheni amasha.

Amamodeli Olimi Oluphindaphindayo athatha indlela ehlukile, nenhle ngendlela emangalisayo. Esikhundleni sokudlulisa konke ukwaziswa ku-LLM isikhathi ngasinye, umyalo uthathwa njengesethi yezinto eziguquguqukayo ezitholakala endaweni ye-Python REPL (Read-Eval-Print Loop). Imodeli ifakwe amathuluzi ayivumela ukuthi ihlole lezi ziguquguqukayo noma izicele ngokuphindiwe ezingcezuni ezikhethwe ngohlelo.

Umfanekiso ovela ephepheni u-Zhang et al, 2025 | umthombo

Ngamanye amazwi, ama-RLM akhuthaza i-LLM ukuthi ibhale ikhodi ezakha eyakho imisebenzi emincane, bese ixazulula leyo misebenzi engaphansi ngokuzibiza ngokuphindaphindiwe. Lokhu kushintsha umthwalo osuka ekumpintsheni yonke into uwenze ekwazisweni okukodwa kuya ekuhleleni inkinga ngendlela yokuthi imodeli ingakwazi ukuzulazula ezimongweni ezinkulu ngendlela enokwethenjelwa.

Ababhali bahlole indlela yabo yonkana imisebenzi eminingana yomkhathizwe omude, lapho ama-RLM alethe imiphumela eqinile kuzo zombili izinhlobo ze-GPT-5 ne-Qwen-3.

Umfanekiso ovela ephepheni u-Zhang et al, 2025 | umthombo

Imiphumela ibukeka ithembisa ngokwedlulele. Ama-RLM (anamakholi amancane noma angenawo) ahlala edlula ezinye izindlela kuyo yonke imisebenzi. Ake sibone ukuthi lokhu kusebenza kanjani ekusebenzeni.

Ukusebenzisa i-RLM ekusebenzeni

Isimo esisodwa esivamile lapho umongo omude ukhanya ngempela ukuphendula imibuzo ngesisekelo solwazi esikhulu. Yilokho kanye esizozama lapha. Ngithathe zonke izindatshana engizishicilele ku-Towards Data Science futhi ngazilayisha efayeleni elilodwa le-Markdown. Ngokumangazayo, lokho kwengeza cishe ku-1.5 MB wombhalo. Ngethemba, lokho kwanele ukuze imodeli igubhe.

Ngenhlanhla, i-DSPy isanda kwethula ukuqaliswa kwe-Recursive Language Models inference approach. Lokhu kusho ukuthi asidingi ukuzakhela lutho thina; sidinga nje inguqulo ye-DSPy 3.1.2 noma entsha.

pip install dspy --upgrade

Ake siqale ngokulayisha idathasethi.

with open('articles.md', 'r') as f:
    articles = f.read()

Okulandelayo, ake sihlole ukuthi mangaki amathokheni equkethe.

import anthropic

client = anthropic.Anthropic(api_key=config['ANTHROPIC_API_KEY'])

# Count tokens for messages
token_count = client.messages.count_tokens(
  model="claude-sonnet-4-5",
  messages=[
    {"role": "user", "content": articles}
  ]
)

print(f"Input tokens: {token_count.input_tokens}")
# Input tokens: 386768

Cishe kukhona amathokheni angu-400K kumongo wethu. I-Claude Sonnet 4.5 isekela iwindi lokuqukethwe elingu-200K, ngakho-ke ukucubungula yonke idathasethi ngomyalo owodwa akwenzeki. Yilapho kanye i-RLM iba usizo khona.

Ukuze sisebenzise i-DSPy, sidinga kuqala ukulungisa imodeli yolimi. Njengoba kuxoxiwe ngaphambili, i-RLM incike kukhodi ukusebenzisana nokwaziswa, ngakho isebenza kangcono ngamamodeli anamandla okubhala amakhodi aqinile. Ngalesi sizathu, ngizosebenzisa u-Claude kulesi sibonelo, njengoba kwaziwa ngokwenza kahle emisebenzini ehlobene nekhodi.

lm = dspy.LM('anthropic/claude-sonnet-4-5', api_key=config['ANTHROPIC_API_KEY'])
dspy.configure(lm=lm)

Okulandelayo, siqala i-RLM ngokucacisa isiginesha yayo. Kulesi simo sokusetshenziswa, ngidlula isethi ephelele yama-athikili kanye nombuzo, futhi ngilindele imodeli ukuthi ikhiphe amathrendi ayinhloko futhi iwabuyisele njengohlu lwezintambo.

rlm = dspy.RLM('articles, question -> trends: list[str]')

Lapha, ngisebenzisa i-Claude Sonnet 4.5 kukho kokubili imodeli eyinhloko kanye nezingcingo ezincane eziphindaphindayo. I-DSPy futhi ikuvumela ukuthi usebenzise imodeli encane kumakholi amancane nge sub_lm ipharamitha, engasiza ukunciphisa izindleko.

Manje sesingakwazi ukwenza i-RLM futhi sifinyelele i- trends inkambu kokuphumayo.

output = rlm(
  articles = articles, 
  question = '''What were the main AI trends of 2025 based on provided 
    articles? Pay attention to the content not only the titles.'''
)

print('n'.join(output.trends))

# Agentic AI and Autonomous Systems: Self-reflection patterns, iterative improvement through feedback loops (Self-Refine, Reflexion, CRITIC), and LLMs as reasoning engines that can autonomously plan and execute tasks
# Multi-Agent AI Systems: Evolution from single agents to collaborative teams of specialized agents with distinct roles, using frameworks like LangGraph, CrewAI, and AutoGen for orchestration
# Context Engineering and RAG: Moving beyond static prompting to dynamic retrieval-augmented generation (RAG), adaptive memory systems, and self-improving contexts that learn from experience without retraining
# Standardization Protocols: Emergence of Model Context Protocol (MCP) for standardizing LLM-tool integrations and Agent Communication Protocol (ACP) for inter-agent communication, reducing integration complexity
# Tool-Using LLMs and Function Calling: LLMs equipped with ability to invoke external tools, execute SQL queries, browse web, and interact with APIs through structured function calling mechanisms
# Production-Ready AI Frameworks: Mature ecosystem including LangGraph, DSPy, LangChain, NeMo Agent Toolkit, CrewAI, and AutoGen, focused on moving from prototype to production with built-in observability
# LLM Evaluation and Observability: LLM-as-judge evaluation patterns, comprehensive metrics frameworks (Ragas, DeepEval, Evidently), trajectory evaluation, and continuous monitoring as essential production infrastructure
# Programming Over Prompting: Shift toward declarative, code-based AI development with frameworks like DSPy and configuration-driven approaches (YAML-based) replacing prompt engineering
# Framework Interoperability: Tools designed to integrate across multiple frameworks rather than create silos, enabling composable AI architectures that leverage best features from different ecosystems
# Local and Cost-Effective LLM Deployment: Running smaller efficient models locally (Llama, Ollama) to reduce API costs and enable experimentation, with focus on cost-quality-latency tradeoffs
# SQL Agents and Data Analysis Automation: LLM agents specialized in data analysis tasks, generating and executing SQL queries, with applications in replacing or augmenting traditional data analyst workflows
# Production Quality and Accuracy Enhancement: Techniques for improving LLM accuracy including chain-of-thought reasoning, structured outputs through function calling, and iterative refinement for business-critical applications

Ukubulawa kuthathe cishe imizuzu emithathu, futhi umphumela waba isifinyezo esizwakalayo esizwakalayo sezindikimba eziyinhloko kuzo zonke izihloko zami. Nokho, asikho lapha ukuze sifunde mayelana namathrendi ngokwawo. Umbuzo othakazelisa kakhulu ukuthi i-RLM yakwazi kanjani ukwenza lokhu kwasekuqaleni. Ngakho ake sijule.

I-RLM ngaphansi kwe-hood

Ngokwemvelo, ingxenye ethakazelisa kakhulu ukuqonda ukuthi empeleni kwenzekani ngaphansi kwe-hood.

Ukuqaliswa kwe-RLM

Njengoba kuxoxiwe ngaphambili, umqondo oyinhloko ngemuva kwamamodeli olimi oluphindaphindayo ukuthi izimo ezinde zithathwa njengengxenye yendawo yangaphandle, kunokuba zinikezwe ngokuqondile kumodeli njengokwaziswa okukodwa. Esikhundleni salokho, i-LLM ibhala ikhodi ye-Python ukuze ihlole ngokuhlelekile, ibole, futhi icele ngokuphindaphindiwe ama-LLM angaphansi phezu kwamazwibela amancane edatha.

Ezingeni eliphezulu, ukusetshenziswa kunezici ezimbalwa ezibalulekile:

  • Isebenzisa i-sandboxed Python REPL (Read–Eval–Print Loop) evumela i-LLM ukuthi ihlole izimo ezinkulu ngokusebenzisa ikhodi.
  • I-LLM isebenza ku-loop evamile ye-agent: ibhala ikhodi ye-Python, ibheka okukhiphayo, bese inquma ukuthi yini okumele iyenze ngokulandelayo.
  • Ingenza izingcingo ezingaphansi eziphindaphindayo (izibiza kahle) isebenzisa amathuluzi afana llm_query() futhi llm_query_batched() ukuhlaziya izingcezu ezincane ngokwemantiki.
  • Uma imodeli isinelisekile ngomphumela, iphothula inqubo ngokushaya ucingo SUBMIT() ngokuphumayo.

Ukwaziswa

Ukuze ngiqonde ngempela ukuthi lokhu kusebenza kanjani, ngikuthola kuwusizo ukuhlola imilayezo yangempela ethunyelwa noma isuka ku-LLM. I-DSPy yenza lokhu kube lula ngomyalo olandelayo.

# Inspect the raw LLM calls - shows the actual prompts sent to the model
dspy.inspect_history(n=39)

Lokhu kusinika ukubonakala okugcwele kulokho okwabiwe nemodeli esinyathelweni ngasinye.

Ake siqale ngomlayezo wesistimu. Ichaza okokufaka okuguquguqukayo okutholakala kumodeli (njengoba kucaciswe kusiginesha ye-RLM) futhi iklelisa imisebenzi imodeli engayibiza, njenge printizingcingo ze-LLM eziphindayo, nezinsiza ezijwayelekile zelabhulali.

Ngokuphawulekayo, imojula ye-RLM futhi ikuvumela ukuthi udalule imisebenzi yangokwezifiso ku-Python REPL nge tools ipharamitha lapho uqala i-RLM. Kulesi sibonelo, ngithembele kuphela emisebenzini ezenzakalelayo, kodwa ekusetheni okuthuthuke kakhulu lokhu kungaba iphuzu elinamandla lesandiso.

Your input fields are:
1. `variables_info` (str): Metadata about the variables available in the REPL
2. `repl_history` (REPLHistory): Previous REPL code executions and their outputs
3. `iteration` (str): Current iteration number (1-indexed) out of max_iterations
Your output fields are:
1. `reasoning` (str): Think step-by-step: what do you know? What remains? Plan your next action.
2. `code` (str): Python code to execute.
All interactions will be structured in the following way, with the appropriate values filled in.

[[ ## variables_info ## ]]
{variables_info}

[[ ## repl_history ## ]]
{repl_history}

[[ ## iteration ## ]]
{iteration}

[[ ## reasoning ## ]]
{reasoning}

[[ ## code ## ]]
{code}

[[ ## completed ## ]]
In adhering to this structure, your objective is: 
Given the fields `articles`, `question`, produce the fields `trends`.
        
You are tasked with producing the following outputs given the inputs `articles`, `question`:
- {trends}        # note: the value you produce must adhere to the JSON schema: {"type": "array", "items": {"type": "string"}}
        
You have access to a Python REPL environment. Write Python code and it will be executed. You will see the output, then write more code based on what you learned. This is an iterative process.

Available:
- Variables: `articles`, `question` (your input data)
- `llm_query(prompt)` - query a sub-LLM (~500K char capacity) for semantic analysis
- `llm_query_batched(prompts)` - query multiple prompts concurrently (much faster for multiple queries)
- `print()` - ALWAYS print to see results
- `SUBMIT(trends)` - submit final output when done
- Standard libraries: re, json, collections, math, etc.
        
IMPORTANT: This is ITERATIVE. Each code block you write will execute, you'll see the output, then you decide what to do next. Do NOT try to solve everything in one step.
        
1. EXPLORE FIRST - Look at your data before processing it. Print samples, check types/lengths, understand the structure.
2. ITERATE - Write small code snippets, observe outputs, then decide next steps. State persists between iterations.
3. VERIFY BEFORE SUBMITTING - If results seem wrong (zeros, empty, unexpected), reconsider your approach.
4. USE llm_query FOR SEMANTICS - String matching finds WHERE things are; llm_query understands WHAT things mean.
5. MINIMIZE RETYPING (INPUTS & OUTPUTS) - When values are long, precise, or error-prone (IDs, numbers, code, quotes), re-access them via variables and parse/compute in code instead of retyping. Use small, targeted prints to sanity-check, but avoid manual copying when variables can carry the exact value.
6. SUBMIT ONLY AFTER SEEING OUTPUTS - SUBMIT ends the current run immediately. If you need to inspect printed output, run it in one step, review the result, then call SUBMIT in a later step.
        
You have max 50 sub-LLM calls. When done, call SUBMIT() with your output.

Ake sibheke nomlayezo wokuqala womsebenzisi othunyelwe ku-LLM. Lokhu kunikeza imodeli isifinyezo sezinto eziguquguqukayo zokufakwayo: izinhlobo zazo, ubude (ukuze imodeli yazi ukuthi ingafunda okungakanani ngesikhathi esisodwa), kanye nokuhlola kuqala kokuqukethwe ukuqonda isakhiwo.

[[ ## variables_info ## ]]
[1] «««
    Variable: `articles` (access it in your code)
    Type: str
    Total length: 1,392,921 characters
    Preview:
    ```
    ---
    title: "Agentic AI from First Principles: Reflection"
    date: "2025-10-24T12:00:00-05:00"
    category: "Agentic AI"
    read_time: "21 min read"
    url: "
    ---
    
    Arthur C. Clarke's Third Law says that "*any sufficiently advanced technology is indistinguishable from magic*". That's exactly how a lot of today's AI frameworks feel. Tools like GitHub Copilot, Claude Desktop, OpenAI Operator, and Perplexity Comet are automating everyda...
    ```
»»»
[2] «««
    Variable: `question` (access it in your code)
    Type: str
    Total length: 114 characters
    Preview:
    ```
    What were the main AI trends of 2025 based on provided articles? Pay attention to the content not only the titles.
    ```
»»»
[3] «««
    Variable: `verbose` (access it in your code)
    Type: bool
    Total length: 4 characters
    Preview:
    ```
    True
    ```
»»»

[[ ## repl_history ## ]]
You have not interacted with the REPL environment yet.

[[ ## iteration ## ]]
1/20

Respond with the corresponding output fields, starting with the field `[[ ## reasoning ## ]]`, then `[[ ## code ## ]]`, and then ending with the marker for `[[ ## completed ## ]]`.

Nansi impendulo yokuqala yemodeli ngokuhambisana nefomethi eshiwo kumlayezo womsebenzisi.

[[ ## reasoning ## ]]
I need to analyze articles to identify main AI trends of 2025. Let me start by exploring the data:

1. First, I'll examine the structure and content of the `articles` variable to understand what I'm working with
2. I'll need to look at multiple articles, not just titles, to understand the actual content
3. Then I'll use semantic analysis (llm_query) to extract and identify trends
4. Finally, I'll compile the trends into a list

Let me start by exploring the articles data to see its structure and get a sense of what's available.

[[ ## code ## ]]
# First, let's understand the structure of the articles
print("Type of articles:", type(articles))
print("nLength of articles:", len(articles))
print("n" + "="*80)
print("First 2000 characters:")
print(articles[:2000])
print("n" + "="*80)

# Let's see if we can identify the structure - looks like articles are separated
# Let's try to split and count them
article_separator = "---ntitle:"
article_parts = articles.split(article_separator)
print(f"nNumber of article parts found: {len(article_parts)}")
print(f"First part length: {len(article_parts[0])} (likely empty or header)")
print(f"Second part length: {len(article_parts[1]) if len(article_parts) > 1 else 0}")

[[ ## completed ## ]]

Amalogi aluhlaza asinike ukuqonda okuqinile kokuthi i-LLM isebenzisana kanjani nemvelo engaphansi kwe-hood. Okulandelayo, ake sihlole i-trajectory eyalandelwa yi-LLM ukuze sifinyelele umphumela wayo wokugcina.

I-Trajectory

Ukuze uthole umbono ohlelekile we-trajectory, singahlola output.trajectory. Lokhu kunikeza ukufinyelela esinyathelweni ngasinye sokucabanga kwemodeli, ikhodi eyikhiqizayo, kanye nemiphumela ewumphumela. Empeleni, inikeza ukubuka okuphelele kwakho konke ukusebenzisana kwe-REPL.

# Examine the full trajectory - this shows all REPL interactions
for i, step in enumerate(output.trajectory):
  print(f"n{'='*60}")
  print(f"STEP {i+1}")
  print(f"{'='*60}")
  print(f"n📝 REASONING:n{step['reasoning']}")
  print(f"n💻 CODE:n{step['code']}")
  print(f"n📤 OUTPUT:n{step['output'][:1000]}{'...' if len(step['output']) > 1000 else ''}")

Ungathola futhi ilogi ephelele ku-GitHub.

Ukubuyekeza umkhondo kusisiza ukuthi siqonde amaphethini amakhulu i-LLM ewasebenzisayo ukuxazulula inkinga. Kulokhu, kuthathe izinyathelo ezingu-13 ukufinyelela impendulo yokugcina.

Isinyathelo sokuqala, njengoba bekulindelekile, kwaba ukuhlola articles okuguquguqukayo: ukuhlola ukwakheka kwayo nokuthola umuzwa wedatha etholakalayo. Lokhu kuhlola kokuqala kusetha isiteji sayo yonke imicabango nezingcingo ezincane.

# First, let's understand the structure of the articles
print("Type of articles:", type(articles))
print("nLength of articles:", len(articles))
print("n" + "="*80)
print("First 2000 characters:")
print(articles[:2000])
print("n" + "="*80)

# Let's see if we can identify the structure - looks like articles are separated
# Let's try to split and count them
article_separator = "---ntitle:"
article_parts = articles.split(article_separator)
print(f"nNumber of article parts found: {len(article_parts)}")
print(f"First part length: {len(article_parts[0])} (likely empty or header)")
print(f"Second part length: {len(article_parts[1]) if len(article_parts) > 1 else 0}")

Okulandelayo, i-LLM yabona ukuthi kunezihloko ezingama-40 sezizonke, ngasinye sihlukaniswe ---ntitle:nokuthi yonke i-athikili iqukethe izinkambu zemethadatha njenge title, date, category, read_timefuthi urlkulandelwa okuqukethwe okuyinhloko. Ukuhlonza nje lesi sakhiwo kufayela lombhalo elingu-1.5 MB sekuvele kuyimpumelelo enkulu.

Ngokwakhela kulokhu kuqonda, i-LLM yabe isihlaziya ama-athikili futhi yakhiqiza isifinyezo sezihloko ze-athikili nezindikimba eziyinhloko.

# Parse articles into structured format
import re

# Split by the article separator
raw_articles = articles.split("---ntitle:")

# Process each article (skip the first empty element)
parsed_articles = []
for i, raw_article in enumerate(raw_articles[1:], 1):  # Skip first empty element
  # Add back the "title:" that was removed by split
  raw_article = "title:" + raw_article
  
  # Extract metadata using regex
  title_match = re.search(r'title:s*"([^"]*)"', raw_article)
  date_match = re.search(r'date:s*"([^"]*)"', raw_article)
  category_match = re.search(r'category:s*"([^"]*)"', raw_article)
  
  # Find where content starts (after the second "---")
  content_start = raw_article.find("---", 10)  # Skip the first part
  content = raw_article[content_start+3:].strip() if content_start != -1 else ""
  
  parsed_articles.append({
    'index': i,
    'title': title_match.group(1) if title_match else "Unknown",
    'date': date_match.group(1) if date_match else "Unknown",
    'category': category_match.group(1) if category_match else "Unknown",
    'content': content,
    'content_length': len(content)
  })

print(f"Successfully parsed {len(parsed_articles)} articlesn")
print("="*80)
print("Sample of articles (titles and categories):")
print("="*80)
for i, article in enumerate(parsed_articles[:10], 1):
  print(f"{i}. [{article['category']}] {article['title']}")
  print(f"   Content length: {article['content_length']} chars")
  print()

Ngemva kokuhlaziya ama-athikili, i-LLM yanquma ukugxila ngokukhethekile kokuqukethwe okuhlobene ne-AI, njengoba umbuzo owawubuzwa ngokuqondile mayelana namathrendi e-AI.

# Let's focus on AI-related articles (AI, Agentic AI, LLM Applications, ChatGPT categories)
# and sample strategically to understand content-based trends

ai_related = [a for a in parsed_articles if a['category'] in [
  'Artificial Intelligence', 'Agentic AI', 'LLM Applications', 'ChatGPT', 'Deep Learning'
]]

Okulandelayo, i-LLM ikhombe izindatshana ezibalulekile ebifuna ukugxila kuzo. Bekuwukukhetha okuzimele okusekelwe ekuhlobaneni nokuqukethwe. Ukuze ihlaziye lezi ngokuningiliziwe, isebenzise izingcingo ezincane eziphindaphindayo, icubungula i-athikili ngayinye ngokohlelo.

Ukuze ulawule umsebenzi ngendlela efanele, i-LLM ihlukanise ama-athikili abe amaqoqo amabili futhi iwacubungule ngokulandelana. Ku-athikili ngayinye, iphinde yanciphisa okuqukethwe izinhlamvu zokuqala ezingu-15K. Leli su livumele imodeli ukuthi ibambe umthamo omkhulu wombhalo ngaphandle kokweqa iwindi lokuqukethwe kwawo, kuyilapho ithwebula imininingwane ebaluleke kakhulu ku-athikili ngayinye.

# Create prompts to extract AI trends from article content
# I'll include a substantial portion of each article's content for analysis

prompts_batch1 = []

for i, article in enumerate(selected_for_analysis[:8]):  # First batch of 8
  # Take first ~15K chars of content to stay within LLM limits while getting substance
  content_sample = article['content'][:15000]
  
  prompt = f"""Analyze this article about AI from 2025 and identify the main AI trends, technologies, methodologies, or concepts it discusses.

Article Title: {article['title']}

Article Content (excerpt):
{content_sample}

Based on the content above, list the key AI trends, technologies, or concepts discussed in this article. Focus on:
- New frameworks, tools, or methodologies mentioned
- Emerging patterns in AI development (e.g., agentic AI, multi-agent systems)
- Important techniques or approaches
- Production/deployment considerations

Provide a concise list of 3-5 main trends/concepts from this article."""

  prompts_batch1.append(prompt)

print(f"Created {len(prompts_batch1)} prompts for first batch")
print("nProcessing first batch of articles...")

# Query the first batch
results_batch1 = llm_query_batched(prompts_batch1)

print(f"nReceived {len(results_batch1)} results")
print("nResults from first batch:")
print("="*80)

for i, (article, result) in enumerate(zip(selected_for_analysis[:8], results_batch1), 1):
  print(f"n{i}. {article['title']}")
  print("-"*80)
  print(result)
  print()

Ekugcineni, i-LLM ibuyekeze uhlu olugcwele lwama-athikili futhi, yahlonza izihloko ezengeziwe ezifanele, futhi yazicubungula kusetshenziswa izingcingo ezincane eziphindaphindayo ngendlela efanayo. Lapho lonke ulwazi selubuyisiwe, luhlanganisa imiphumela ku- trends_2025 okuguquguqukayo (uhlu lwamayunithi ezinhlamvu amelela amathrendi e-AI) futhi yawuthumela njengempendulo yokugcina.

##### STEP 12 #####

# Now let me synthesize all findings into comprehensive AI trends
# I'll review all the results and create a structured summary

print("SYNTHESIZING ALL FINDINGS FROM 20 ANALYZED ARTICLES")
print("="*80)
print("nBased on deep content analysis of 20 AI-focused articles from 2025,")
print("here are the main AI trends identified:n")

# Compile the comprehensive list of trends
trends_2025 = [
  "Agentic AI and Autonomous Systems: Self-reflection patterns, iterative improvement through feedback loops (Self-Refine, Reflexion, CRITIC), and LLMs as reasoning engines that can autonomously plan and execute tasks",
  "Multi-Agent AI Systems: Evolution from single agents to collaborative teams of specialized agents with distinct roles, using frameworks like LangGraph, CrewAI, and AutoGen for orchestration",
  "Context Engineering and RAG: Moving beyond static prompting to dynamic retrieval-augmented generation (RAG), adaptive memory systems, and self-improving contexts that learn from experience without retraining",
  "Standardization Protocols: Emergence of Model Context Protocol (MCP) for standardizing LLM-tool integrations and Agent Communication Protocol (ACP) for inter-agent communication, reducing integration complexity",
  "Tool-Using LLMs and Function Calling: LLMs equipped with ability to invoke external tools, execute SQL queries, browse web, and interact with APIs through structured function calling mechanisms",
  "Production-Ready AI Frameworks: Mature ecosystem including LangGraph, DSPy, LangChain, NeMo Agent Toolkit, CrewAI, and AutoGen, focused on moving from prototype to production with built-in observability",
  "LLM Evaluation and Observability: LLM-as-judge evaluation patterns, comprehensive metrics frameworks (Ragas, DeepEval, Evidently), trajectory evaluation, and continuous monitoring as essential production infrastructure",
  "Programming Over Prompting: Shift toward declarative, code-based AI development with frameworks like DSPy and configuration-driven approaches (YAML-based) replacing prompt engineering",
  "Framework Interoperability: Tools designed to integrate across multiple frameworks rather than create silos, enabling composable AI architectures that leverage best features from different ecosystems",
  "Local and Cost-Effective LLM Deployment: Running smaller efficient models locally (Llama, Ollama) to reduce API costs and enable experimentation, with focus on cost-quality-latency tradeoffs",
  "SQL Agents and Data Analysis Automation: LLM agents specialized in data analysis tasks, generating and executing SQL queries, with applications in replacing or augmenting traditional data analyst workflows",
  "Production Quality and Accuracy Enhancement: Techniques for improving LLM accuracy including chain-of-thought reasoning, structured outputs through function calling, and iterative refinement for business-critical applications"
]

print("MAIN AI TRENDS OF 2025:")
print("="*80)
for i, trend in enumerate(trends_2025, 1):
  print(f"n{i}. {trend}")

print("n" + "="*80)
print(f"nTotal trends identified: {len(trends_2025)}")
print("nThese trends are based on content analysis of articles covering:")
print("- Agentic AI systems and design patterns")
print("- Multi-agent architectures and frameworks")
print("- Production deployment and evaluation")
print("- Emerging protocols and standardization")
print("- Tool use and external system integration")
print("- Cost-effective and accurate LLM applications")

##### STEP 13 #####

# Submit the final list of AI trends from 2025
SUBMIT(trends_2025)

Siyabona ukuthi imodeli ibinobuciko obuhle: iqonda ukwakheka kokuqukethwe kwethu, yahlaziya ama-athikili, futhi yasebenzisa izingcingo eziphindaphindayo ukuze icubungule ngayinye ngayinye. Nokho, kwaba khona igebe elilodwa elibalulekile kulokhu kuhlaziya. Ayinaki ngokuphelele ukuhlunga ngonyaka, noma imethadatha ye-athikili ngayinye yayiqukethe ngokusobala idethi yokushicilela.

Ukubhekana nalokhu, ngasiphinda isicelo, kulokhu ngigcizelela ukubaluleka kokuhlunga ngo-2025, ukuqinisekisa ukuthi imodeli igxile kuphela ezihlokweni zalowo nyaka.

output2 = rlm(
  articles = articles, 
  question = '''What were the main AI trends of 2025 based on provided 
    articles? Pay attention to the content not only the titles. 
    Don't forget to filter by year, this information is present in 
    metadata for each article.'''
)

Kulokhu, imodeli icabange unyaka futhi yenza ukuhlaziya okuyinkimbinkimbi, isebenzisa izinkulumo ezivamile ukuze ikhiphe idethi yokushicilelwa ye-athikili ngayinye.

import re
from datetime import datetime

# Split articles by the separator "---" at the beginning of metadata blocks
# The pattern is: --- followed by metadata, followed by --- followed by content
article_blocks = re.split(r'n---n', articles)

print(f"Total article blocks found: {len(article_blocks)}")
print("n" + "="*80)

# Let's examine the structure - articles seem to start with "---ntitle:"
# Let me try a different approach - find all articles by their metadata pattern
article_pattern = r'---ntitle: "(.*?)"ndate: "(.*?)"ncategory: "(.*?)"nread_time: "(.*?)"nurl: "(.*?)"n---n(.*?)(?=n---ntitle:|$)'

matches = re.findall(article_pattern, articles, re.DOTALL)
print(f"Articles found with regex: {len(matches)}")

if len(matches) > 0:
  print("nFirst article metadata:")
  print(f"  Title: {matches[0][0]}")
  print(f"  Date: {matches[0][1]}")
  print(f"  Category: {matches[0][2]}")
  print(f"  Content preview (first 200 chars): {matches[0][5][:200]}")

Okulandelayo, yahlunga izindatshana ngonyaka futhi yahlonza izindatshana eziyi-13 zango-2025.

# Parse articles and filter for 2025
articles_2025 = []

for match in matches:
  title, date_str, category, read_time, url, content = match
  # Extract year from date string (format: "2025-10-24T12:00:00-05:00")
  year = date_str.split('-')[0]
  
  if year == "2025":
    articles_2025.append({
      'title': title,
      'date': date_str,
      'category': category,
      'content': content.strip()
    })

print(f"Total articles: {len(matches)}")
print(f"Articles from 2025: {len(articles_2025)}")
print("n" + "="*80)
print("2025 Articles:")
print("="*80)

for i, article in enumerate(articles_2025, 1):
  print(f"n{i}. {article['title']}")
  print(f"   Date: {article['date']}")
  print(f"   Category: {article['category']}")
  print(f"   Content length: {len(article['content'])} chars")

Bese, ihlaziye lezi zihloko ze-13 isebenzisa izingcingo eziphindaphindayo futhi yakhiqiza uhlu olubuyekeziwe lwamathrendi. Kulokhu, umsebenzi waqedwa ngendlela efanele. Njengezinye izibonelo eziningi, igqamisa ukubaluleka kokubuza imibuzo ecacile, necacile kanye nokucacisa imibandela nezenzo esifuna imodeli izilandele.

Agentic AI and Multi-Agent Systems: Building autonomous AI agents capable of multi-step reasoning, tool use, planning, and reflection, often with multiple specialized agents collaborating on complex tasks
Code Agents: AI agents that execute tool calls using actual code (Python) instead of JSON-based tool calling, enabling dynamic function creation and achieving higher success rates with fewer steps
Model Context Protocol (MCP): Anthropic's standardization protocol for connecting AI applications to external tools and data sources, reducing integration complexity from M*N to M+N and enabling reusable, framework-agnostic components
Agent Communication Protocol (ACP): Emerging open protocol under the Linux Foundation for standardizing communication between AI agents via RESTful APIs, enabling interoperability across different frameworks
Reflection and Self-Refinement Patterns: LLMs reviewing and improving their own outputs through iterative feedback loops, including self-feedback, verbal reinforcement learning, and tool-interactive critiquing, achieving 10-30% accuracy improvements
Framework Ecosystem Proliferation: Multiple competing frameworks including LangGraph, smolagents, CrewAI, DSPy, and NeMo Agent Toolkit, with growing emphasis on interoperability and declarative configuration approaches
Production-Ready LLM Infrastructure: Moving beyond prototypes to address 'day 2' problems like API exposure, observability, monitoring, evaluation frameworks, and deployment at scale
Parameter-Efficient Fine-Tuning (PEFT) and LoRA: Techniques for customizing LLMs by updating only small subsets of parameters, enabling task-specific optimization while reducing computational costs and enabling on-premises deployment
Advanced Fine-Tuning with Memory Experts: Lamini's Mixture of Memory Experts (MoME) using ~1 million LoRA adapters for near-perfect factual accuracy (95%) with zero loss on specific information
Shift from Prompting to Programming Paradigm: Frameworks like DSPy treating LLM tasks as modular programming rather than manual prompt crafting, with structured signatures and reusable components
LLM Evaluation and Quality Assurance: Comprehensive evaluation frameworks (Evidently, DeepEval, MLFlow, LangSmith) for testing, monitoring, and ensuring reliability in production, especially for regulated industries
RAG (Retrieval-Augmented Generation): Providing relevant context and knowledge bases to enhance LLM precision and enable specialized capabilities in agents
Tool Use and Orchestration: AI systems dynamically selecting and executing tools from multiple sources, with standardized tool definitions and safety controls
YAML-Based Declarative Configuration: Defining LLM workflows, models, and agent behavior through configuration files rather than purely code-based implementations
Interpretable AI and Rule-Based Systems: Using decision trees, extracted rules, and transparent models as alternatives to black-box approaches for compliance, explainability, and rapid deployment in regulated industries

Isifinyezo

Sekuyisikhathi sokuthi sisonge izinto futhi sizindle ngesikufundile. Kulesi sihloko, sihlole i-RLM (Recursive Language Models) — isu elisha lokucabanga elivumela ama-LLM ukuthi asingathe okuqukethwe kufika kuma-oda amabili obukhulu amakhulu kunewindi lomongo ojwayelekile, kuyilapho enciphisa inkinga yokubola komongo.

Ingithakasela ngempela le ndlela. Iphepha liphakamisa indlela elula kodwa enhle yokuphatha ukwaziswa njengokuguquguqukayo endaweni ye-Python, okungikhumbuza ngohlaka lwami oluthandayo lwe-ejenti, ama-smolagents ka-HuggingFace. Ngikholelwa ukuthi le ndlela isebenza kahle kakhulu ngoba ama-LLM aqeqeshwe ngekhodi eningi kangangokuthi ukuhlela kuzwakala njengolimi lwendabuko kubo. Ukusebenzisa ikhodi njengesixhumi esibonakalayo sokucabanga nokuphindaphinda kuyasebenza futhi kunamandla.

Sekukonke, Amamodeli Olimi Oluphindaphindayo anikeza indlela engokoqobo nenhle yokuphusha imikhawulo yobude bomongo, okwenza ama-LLM akwazi ukuphatha imisebenzi eyinkimbinkimbi, emikhulu. Nokho, imiyalelo ecacile nesiqondiso esicatshangelwayo kusewukhiye wokuthola imiphumela engcono kakhulu.

Ngiyabonga ngokufunda. Ngethemba ukuthi lesi sihloko besinokuqonda. Khumbula iseluleko sika-Einstein: “Into ebalulekile iwukuba ungayeki ukubuza. Ilukuluku linesizathu salo sokuba khona.” Kwangathi ilukuluku lakho lingakuholela ekuqondeni kwakho okulandelayo okuhle.

Ireferensi

Le ndatshana isuselwe ephepheni lika-Zhang et al., “Amamodeli Olimi Oluphindaphindiwe”, eshicilelwe ngoDisemba 31, 2025.

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button