DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to study a from-scratch causal Transformer in PyTorch with LLM Legislativo

Read and test an explicit GPT-style decoder built without pretrained weights or the Hugging Face Trainer.

Short answer: Clone the repo: (inferred) git clone https://github.com/BaruqueRodrigues/llm-legislativo; then open the model package at src/legislm/model/ and read the causal self-attention, GELU, and weight tying code; read the training code in src/legislm/training/ to see how the loss is divided by the total number of valid targets in an update. All steps.

  • Top pick
  • Research
  • Intermediate
  • 1 hour
  • From the README
  • Any agent

Authorization notice. LLM Legislativo is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.

Who it is forAn ML student or engineer who wants to learn how a causal decoder is built and trained, and does not want a black-box trainer.

The problemMost LLM code hides the model and training loop behind libraries, which makes the mechanics hard to learn.

The outcomeA clear reading of the attention, weight tying, and gradient accumulation code, with the repo's unit tests as a check on understanding.

What you need first

  • A Python environment (the README install section is cut off in the source, so exact setup steps are unconfirmed)
  • Internet access to Hugging Face Hub and GitHub
  • Enough disk space for the Parquet release if you download corpus files (the raw TAR archives total over 360 GiB)
  • Basic familiarity with PyTorch and Hugging Face datasets for the model and corpus steps

Steps

  1. Clone the repo: (inferred) git clone https://github.com/BaruqueRodrigues/llm-legislativo (inferred, check the README)
  2. Open the model package at src/legislm/model/ and read the causal self-attention, GELU, and weight tying code.
  3. Read the training code in src/legislm/training/ to see how the loss is divided by the total number of valid targets in an update.
  4. Install the CPU lockfile with pip install -r requirements-cpu.lock and run the tests in tests/ with pytest. (inferred, check the README)

Prompt for your agent

Clone https://github.com/BaruqueRodrigues/llm-legislativo and explain how the causal attention and the gradient accumulation loss are implemented in src/legislm/model/ and src/legislm/training/. Output a short summary with file paths and line references. Verify each claim by reading the code, and say so if a file is missing.

Caveat. The README install section is truncated in the source, so the setup commands above are partly inferred and need checking against the repo.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for BaruqueRodrigues/llm-legislativo and "Study a from-scratch causal Transformer in PyTorch"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer