Python Programming, AI Fundamentals, and Agentic Empirical Research

Detailed Syllabus Beyond the Poster

1-Hour Public Class: University-Style Expanded Outline

This is regular webpage content below the poster; the poster itself stays unchanged. Although the public class is one hour, it is organized like a university course introduction: build the knowledge map, then clarify the concepts, demonstrations, follow-up assignments, and learning path for each module.

Course Information

Course Type
Free public class
Designed to map the full learning path and diagnose next steps.
Length
60 minutes
Lecture, demonstration, self-diagnosis, and follow-up learning advice.
Audience
Social-science researchers and students
For learners who want Python, AI, and causal inference in one research workflow.
Format
Concept lecture plus case demonstration
The focus is where each tool fits in research, not a list of software names.
Tools
Python / Jupyter / VSCode / Stata / R / StatsPAI
The class demonstrates the toolchain; full installation is not required during the session.

Learning Objectives

  • Map the full path from Python, data engineering, machine learning, deep learning, and causal inference to agentic research automation.
  • Understand what CNN, RNN, LSTM, GRU, seq2seq, attention, Transformer, and large language models are designed to solve.
  • Separate prediction, explanation, and causal identification, and understand why AI cannot replace research design.
  • See agents as tool-using research assistants that require logs, code execution, verification, and human review.
  • Diagnose whether your next learning priority is Python workflow, econometric identification, AI architecture, or agentic automation.

Prerequisites

  • No Python background is required, but participants should be willing to read code examples.
  • A basic statistics, econometrics, or empirical-methods background is recommended.
  • It helps to know regression tables, variables, samples, treatment groups, and comparison groups.
  • Participants may bring one empirical research question to compare against the course roadmap.

Module Schedule

The public class has four parts. Each includes a conceptual frame, research example, tool demonstration, and follow-up task.

Part 1

Python and Reproducible Research Workflow

About 12 minutes

This part explains why modern empirical research needs scripted workflows: data download, cleaning, descriptive statistics, figures, regression tables, and report drafts should be traceable, rerunnable, and auditable.

Lecture Topics
  • Python project folders: data, scripts, notebooks, tables, figures, logs, and README.
  • Jupyter for exploration, scripts for replication, and Git for recording changes.
  • How pandas supports cleaning, merging, reshaping, grouping, and export.
  • How Stata, R, and Python can cross-check each other instead of becoming separate black boxes.
In-Class Lab
  • Demonstrate a minimal reproducible empirical project with raw data, a cleaning script, a descriptive table, and an output figure.
  • Turn a manual Excel-style workflow into a rerunnable Python pipeline.
Key Questions
  • What file structure makes a research task easier for an AI agent to understand?
  • Which steps must be scripted, and which steps still need human inspection?

Assignment

Break one research project into six folders: raw, processed, scripts, tables, figures, and notes, then describe the purpose of each folder.

Module Deliverable

A personal project-folder map and a minimal replication checklist.

Part 2

AI Principles, Deep Learning, and Large Language Models

About 18 minutes

This part moves from sklearn classification, regression, clustering, and dimensionality reduction into neural networks, then connects CNN, LSTM, GRU, seq2seq, attention, Transformers, and LLMs as one architecture timeline.

Lecture Topics
  • Training, validation, and test sets; cross-validation; loss functions; regularization; overfitting.
  • How CNNs extract local patterns and how LSTM/GRU models handle sequence memory.
  • How seq2seq turns an input sequence into an output sequence and why attention was needed.
  • Transformer components: tokenization, embeddings, positional encoding, Q/K/V, multi-head attention, residual connections, and LayerNorm.
  • LLM pretraining, instruction tuning, alignment, RAG, function calling, and tool use.
In-Class Lab
  • Compare classical ML, a neural model, and an LLM on the same text-classification or variable-explanation task.
  • Dissect one ChatGPT/Codex answer: what comes from model parameters, what should come from retrieval, and what must be checked by code execution.
Key Questions
  • When is classical ML enough, when do we need deep learning, and when do we need an LLM?
  • Why do LLMs hallucinate, and why do RAG and tool calling reduce but not eliminate the risk?

Assignment

Write a one-page model-choice note for a research task, covering features, model options, validation strategy, and failure risks.

Module Deliverable

An AI architecture concept map and a short note on LLM boundaries.

Part 3

How Causal Inference and Machine Learning Connect

About 15 minutes

This part separates predictive accuracy from credible identification. ML can help variable selection, high-dimensional controls, heterogeneity, and nuisance prediction, but it does not create identification by itself.

Lecture Topics
  • Potential outcomes, treatment effects, selection bias, common support, and identification assumptions.
  • RCT, DID, PSM, IV, RD, synthetic control, and event studies.
  • DML, causal forests, heterogeneous treatment effects, and high-dimensional covariates.
  • Robustness checks, placebo tests, mechanism analysis, and result interpretation.
In-Class Lab
  • Use a policy-evaluation example to show how a research question becomes an identification strategy.
  • Compare predicting treatment status with estimating whether the treatment worked.
Key Questions
  • What can ML do for causal inference, and what can it not do?
  • Why must identification strategy come before model complexity?

Assignment

For your own research question, write the treatment, outcome, counterfactual, identification assumption, and one robustness check.

Module Deliverable

A one-page causal-identification diagnostic sheet.

Part 4

Agentic Empirical Research Demonstration

About 15 minutes

This part shows how a natural-language research task can become executable steps where an agent calls Python, Stata, R, StatsPAI, and the filesystem while preserving logs, outputs, and human checkpoints.

Lecture Topics
  • Agent planning, tool selection, short-term memory, long-term memory, and feedback loops.
  • MCP, function calling, file operations, code execution, and provenance records.
  • Automated descriptive statistics, regression tables, figures, code comments, and report drafts.
  • Human checkpoints for identification, variable definitions, sample restrictions, anomalous results, and final wording.
In-Class Lab
  • Show how “run a DID analysis” becomes data checks, variable construction, estimation, interpretation, and report generation.
  • Require the agent to save intermediate files instead of giving only a natural-language answer.
Key Questions
  • Which research steps can be automated, and which remain researcher responsibilities?
  • How should an auditable, reproducible, interruptible agent workflow be designed?

Assignment

Write an agent-executable research briefing with goal, data, variables, constraints, output format, and human checkpoints.

Module Deliverable

An agentic research-task brief.

Model Architecture Track

This track places large language models in the broader history of deep learning: local feature extraction, sequence memory, input-output generation, attention, Transformers, and tool-using LLM agents.

CNN: Convolutional Neural Networks

CNNs answer the question of how to recognize stable local patterns. Instead of connecting every input to every output, they share filters over local windows to detect repeated structures in images, spatial grids, or local text patterns.

Architecture Anatomy
  • Convolution layers slide kernels over inputs to learn edges, shapes, local phrases, or spatial adjacency.
  • Padding and stride control boundary information, feature-map size, and compression speed.
  • Pooling compresses local information and increases translation robustness.
  • Feature maps and receptive fields explain how much of the original input a unit can see.

Research Use

Useful for remote-sensing images, night lights, street views, geographic grids, document images, contract layouts, and local textual features.

Limits and Risks

CNNs are less natural for long-range dependency and complex semantics, so they are often combined with sequence models, attention, or pretrained models.

Lab Connection

Compare hand-crafted features, CNN features, and pretrained embeddings on a small classification task, with attention to overfitting and interpretability.

RNN / LSTM / GRU Sequence Models

The RNN family answers how a model can read a sequence while carrying memory. LSTMs and GRUs use gates to reduce fast forgetting, vanishing gradients, and long-dependency failures.

Architecture Anatomy
  • RNN hidden states pass information from one time step to the next.
  • LSTM input, forget, and output gates decide what to write, retain, and expose.
  • GRU update and reset gates provide a lighter memory-control design.
  • Bidirectional sequence models use both left and right context for labeling and classification.

Research Use

Useful for firm trajectories, financial time series, user behavior sequences, policy-text evolution, and event histories.

Limits and Risks

Sequence models train slowly and parallelize poorly on long text; Transformers are often better for long or complex dependency patterns.

Lab Connection

Use panel or text sequences to compare lagged features, LSTM, and GRU models on out-of-sample performance and explanation cost.

seq2seq and Encoder-Decoder

seq2seq maps one input sequence into one output sequence. It is an early core framework for translation, summarization, Q&A, code generation, and research-report generation.

Architecture Anatomy
  • The encoder turns input text, code, or variable notes into contextual representations.
  • The decoder generates output step by step using prior generated tokens and context.
  • Teacher forcing stabilizes training by feeding the true previous token during learning.
  • Greedy search and beam search trade speed, quality, and diversity at inference time.

Research Use

Explains how natural-language research tasks become code, how regression tables become prose, and how literature paragraphs become summaries.

Limits and Risks

Early seq2seq models compress too much into a bottleneck representation, making long text difficult without attention.

Lab Connection

Convert a variable definition or empirical task into structured JSON or Python pseudocode, then inspect how generation errors arise.

Attention Mechanism

Attention answers which parts of the input the model should consult at the current step. Query, key, and value vectors compute relevance weights so the model can dynamically select information.

Architecture Anatomy
  • Q/K/V: the query asks the current question, keys describe candidate positions, and values carry the information.
  • Scaled dot-product attention computes similarity weights and weighted sums.
  • Cross-attention lets the output side read from the input side during generation.
  • Attention weights can support auditing, but they are not the same as causal explanations.

Research Use

Useful for connecting policy text, paper paragraphs, variable descriptions, interviews, and multi-source evidence.

Limits and Risks

Attention is not reliable causal evidence; long context adds cost, noise, and retrieval errors.

Lab Connection

Use policy text to locate treatment definitions, timing, and sample restrictions, then convert highlighted spans into auditable evidence.

Transformer Architecture

Transformers replace recurrence with self-attention, allowing parallel sequence processing and multi-head relationships. Modern large language models are built on this architecture.

Architecture Anatomy
  • Tokenization and embeddings turn text, code, and symbols into vectors.
  • Positional encoding adds order information.
  • Multi-head self-attention learns dependencies in several representation spaces.
  • Feed-forward networks, residual connections, and LayerNorm support nonlinear expression, stable training, and deep stacks.

Research Use

Used for paper reading, policy-text encoding, summarization, code generation, table interpretation, retrieval-augmented Q&A, and agent planning.

Limits and Risks

Transformers learn statistical associations and task patterns; they do not automatically guarantee factual accuracy, valid identification, or runnable code.

Lab Connection

Dissect one LLM answer: how the prompt is tokenized, how the response is generated, and which parts require RAG, code execution, and human confirmation.

Large Language Models and Agents

LLMs learn language, code, and knowledge patterns through next-token pretraining, then become task-facing through instruction tuning, preference alignment, RAG, function calling, and tool use.

Architecture Anatomy
  • Pretraining learns language distributions, commonsense associations, and code patterns from large corpora.
  • Instruction tuning and alignment improve task following, step-by-step explanation, and output safety.
  • RAG retrieves external sources before generation.
  • Tool calling and MCP let models invoke Python, Stata, R, databases, browsers, or StatsPAI instead of only writing text.

Research Use

Supports topic development, literature reading, coding, debugging, table interpretation, report drafting, replication packaging, and multi-tool workflow coordination.

Limits and Risks

LLMs may hallucinate, misread data, omit identification assumptions, or produce irreproducible conclusions. Logs, code execution, citations, tests, and human review are required.

Lab Connection

Turn a natural-language empirical request into an agent plan where every step leaves files, logs, outputs, and human checkpoints.

Assignments and Assessment

Concept Check

20%

Five diagnostic questions to test your grasp of Python, AI, causal inference, and agent boundaries.

Architecture Concept Map

30%

Place CNN, LSTM, GRU, seq2seq, attention, Transformer, and LLMs on one map with input, information flow, and output.

Personal Learning Plan

50%

List the tools, concepts, and project files you should improve over the next two weeks.

Final Deliverables

  • A personal research-workflow diagnostic sheet.
  • A learning roadmap for AI and causal inference.
  • A self-assessment on whether to join the 4-day bootcamp and which modules deserve the most attention.

Course Norms

  • Participants are encouraged to bring real research questions, but the public class is not a one-on-one paper diagnosis.
  • Every AI output should be checked against data, code, literature, and identification assumptions.
  • The course emphasizes reproducible research: automation should preserve intermediate files and operation logs.