Last updated April 2026 — refreshed for current tool versions (TensorFlow 2.21, Z3 4.15.4, WSL2, Miniforge3).
This guide explains how to run the original DeepCoder — the 2017 Microsoft Research / Cambridge system for neural program synthesis — on a Windows machine. It covers every dependency, the key limitation (the official repo ships utilities only, not the trained model), and the two practical paths forward: native Windows with WSL2 or a community re-implementation.
If you landed here looking for DeepCoder-14B (the 2024 Agentica coding LLM fine-tuned from DeepSeek-Coder), that is a completely different project — see our separate guide on running DeepCoder-14B. The 2017 Microsoft Research DeepCoder described here operates on a 34-function domain-specific language (DSL) to synthesise short programs from input/output examples, not on natural-language coding prompts.
What changed in 2026 — read before you follow older guidesTensorFlow 2.21.0 (March 2026) requires Python 3.10–3.13. The Python 3.6–3.8 versions cited in pre-2024 guides are no longer supported by any current TF release.TensorFlow GPU on native Windows is gone. TF 2.10 (September 2022) was the last version to support GPU on native Windows. If you need GPU, you must use WSL2.Mambaforge is deprecated (retired January 2025). Use Miniforge3 instead for conda environment management.Z3 solver pip package is nowz3-solver 4.15.4.0(October 2025). The oldz3-solver 4.11.xversions still work but miss bug fixes.The official Microsoft repo does not ship the neural model. Themicrosoft/DeepCoder-Utilsrepository provides only the DSL utilities (C++ enumerative search and a Python I/O sample generator). The trained neural network weights were never open-sourced. Community re-implementations (PCCoder, deep-coder) are your practical options.WSL2 is now the recommended Windows path for any TensorFlow GPU work, and the single-commandwsl --installmakes setup straightforward on Windows 10 build 19041+ and Windows 11.
TL;DR
| Question | Answer |
|---|---|
| What is the 2017 DeepCoder? | Neural program synthesis system: predicts which of 34 DSL functions are needed, then runs enumerative search |
| Does the official repo include the model? | No. Only DSL utilities. Use PCCoder or HiroakiMikami/deep-coder for a full implementation. |
| Python version required? | 3.10–3.13 for TF 2.21; community re-implementations may accept 3.9+ |
| TensorFlow GPU on Windows? | WSL2 only (TF 2.10 was the last native-Windows GPU release) |
| Easiest path? | Install WSL2, run Ubuntu 24.04, follow the Linux-inside-WSL2 steps |
| Z3 solver install? | pip install z3-solver (4.15.4.0 as of late 2025) |
What Is the 2017 Microsoft Research DeepCoder?
DeepCoder was introduced in the paper "DeepCoder: Learning to Write Programs" (Balog, Gaunt, Brockschmidt, Nowozin, Tarlow — ICLR 2017, arXiv:1611.01989). The core idea: instead of searching blindly for a program consistent with a set of input/output examples, train a neural network to predict which functions from a fixed DSL are likely to appear in the answer. Feed those predictions to enumerative search. The result is an order-of-magnitude speedup over a baseline that searches without neural guidance.
The DSL (34 functions)
The system works over a bespoke domain-specific language, not general Python. Functions fall into two categories:
- First-order: HEAD, LAST, TAKE, DROP, ACCESS, MIN, MAX, REVERSE, SORT, SUM
- Higher-order: MAP, FILTER, COUNT, ZIPWITH, SCANL1, each parameterised by lambda arguments such as
(+1),(*2),(**2),(>0),(%2==0), and so on.
Programs in this language have a maximum length of 5 statements. The search space for length-5 programs is on the order of 1010; the neural guide reduces effective search depth substantially.
What the Official Repo Actually Contains
The microsoft/DeepCoder-Utils repository (MIT licence, active as of 2026) provides:
generate_io_samples.py— Python script to generate input/output example sets for programs in the DSL.enumerative-search/— C++11 implementation of the enumerative search algorithm. Build withmake(requires g++).
It does not include the trained neural network model or training code. The Microsoft Research team never open-sourced the weights. If you want to run the full neural-guided synthesis pipeline, you need a community re-implementation.
Community Re-implementations to Know
| Project | GitHub | Notes |
|---|---|---|
| PCCoder | amitz25/PCCoder | Most complete; includes full neural model + RobustFill attention variant |
| deep-coder (HiroakiMikami) | HiroakiMikami/deep-coder | Clean Python re-implementation; trains from scratch on the DSL |
| deepcoder (dkamm) | dkamm/deepcoder | Prototype used as base for PCCoder |
| DeepCoder-Utils (Microsoft) | microsoft/DeepCoder-Utils | Official utilities only — no model |
For most researchers, PCCoder is the recommended starting point: it ships the neural predictor, the search integration, and benchmark scripts in one repository.
System Requirements (April 2026)
Hardware
- CPU: Intel Core i5/i7 or AMD Ryzen 5/7 (multi-core; 6+ cores beneficial for search)
- RAM: 16 GB minimum recommended (8 GB functional for CPU inference; training needs 32 GB+)
- Storage: 15 GB free (Python environment + datasets)
- GPU (optional): NVIDIA GPU with CUDA 11.2+ support. Required only for GPU-accelerated training. Note: GPU acceleration under TensorFlow 2.11+ requires WSL2, not native Windows.
Software
- OS: Windows 10 build 19041+ or Windows 11 (64-bit)
- Python: 3.10, 3.11, 3.12, or 3.13 (required by TensorFlow 2.21). Python 3.9 is no longer supported.
- TensorFlow: 2.21.0 (current as of March 2026) for CPU; 2.10.x only if you need native-Windows GPU (not recommended for new setups).
- Z3 Solver:
z3-solver 4.15.4.0(October 2025 release), installable via pip. - C++ toolchain: Visual Studio Build Tools 2022 or MSVC 2019 (for compiling the enumerative-search C++ component).
- WSL2 (strongly recommended for GPU and Linux-script compatibility).
Path A: Native Windows (CPU-only)
This path runs TensorFlow 2.21 directly on Windows. You will not get GPU acceleration, but it is the quickest way to get a working environment for experimentation and inference on small programs.
Step 1 — Install Miniforge3
Miniforge3 replaces the deprecated Mambaforge (retired January 2025) and the heavyweight Anaconda. It is lighter, uses the conda-forge channel by default, and resolves dependencies faster with Mamba.
- Download the latest Miniforge3 Windows installer from github.com/conda-forge/miniforge/releases.
- Run the installer. Accept the default options. Do not add to PATH during the wizard — use the "Miniforge Prompt" from the Start menu instead.
Step 2 — Create a Python Environment
conda create -n deepcoder python=3.11 -y
conda activate deepcoderStep 3 — Install Visual C++ Redistributable and Build Tools
TensorFlow on Windows requires the Microsoft Visual C++ Redistributable for Visual Studio 2015–2022. Download from visualstudio.microsoft.com/downloads/ — scroll to "Other Tools, Frameworks, and Redistributables" and install the x64 version.
To compile the C++ enumerative-search component, also install Visual Studio Build Tools 2022 with the "Desktop development with C++" workload.
Step 4 — Install TensorFlow 2.21 (CPU)
pip install --upgrade pip
pip install tensorflow==2.21.0Verify:
import tensorflow as tf
print(tf.__version__) # 2.21.0
print(tf.reduce_sum(tf.random.normal([100, 100]))) # scalar tensor, no errorsStep 5 — Install Z3 Solver
pip install z3-solver==4.15.4.0Verify:
import z3
print(z3.get_version_string()) # 4.15.4.0Step 6 — Clone the Repository
For the official utilities only:
git clone https://github.com/microsoft/DeepCoder-Utils.git
cd DeepCoder-UtilsFor the full neural pipeline (recommended):
git clone https://github.com/amitz25/PCCoder.git
cd PCCoder
pip install -r requirements.txtStep 7 — Build the C++ Enumerative Search
Inside DeepCoder-Utils/enumerative-search/:
makeOn Windows you may need to use the Developer Command Prompt for VS 2022 or install mingw-w64 via conda:
conda install -c conda-forge m2w64-toolchain -y
makePath B: WSL2 (Recommended — GPU Support and Full Compatibility)
WSL2 with Ubuntu 24.04 LTS is the recommended Windows path for any work that requires GPU acceleration, or if native Windows throws compatibility errors with C++ build scripts or Linux-targeted shell code.
Step 1 — Enable WSL2
Open PowerShell as Administrator:
wsl --installThis single command enables WSL2 and installs Ubuntu (default distribution) on Windows 10 build 19041+ and Windows 11. Restart when prompted.
To install Ubuntu 24.04 LTS explicitly:
wsl --install -d Ubuntu-24.04Step 2 — GPU Setup Inside WSL2 (NVIDIA)
Install the NVIDIA Windows driver on the host (do not install a Linux NVIDIA driver inside WSL2 — the Windows driver is stubbed into WSL2 automatically as libcuda.so). Then inside WSL2:
sudo apt-get update
sudo apt-get install -y cuda-toolkit-12-xVerify GPU visibility:
nvidia-smiStep 3 — Install TensorFlow with GPU Inside WSL2
pip install tensorflow[and-cuda]==2.21.0Verify GPU detection:
import tensorflow as tf
print(tf.config.list_physical_devices('GPU'))Step 4 — Continue with Linux Steps
Once inside WSL2/Ubuntu, follow the same package installs as Path A (pip, z3-solver, git clone) — all standard Linux commands work natively. Use VS Code with the Remote - WSL extension for a seamless Windows editor experience on WSL2 files.
Generating Input/Output Examples
The official utility generates I/O sample datasets for programs in the DeepCoder DSL:
cd DeepCoder-Utils
python generate_io_samples.pyThe script produces JSON-formatted input/output pairs. Each pair looks like:
[
{"input": [3, 1, 2], "output": [1, 2, 3]},
{"input": [5, 4, 6], "output": [4, 5, 6]}
]This implies a SORT operation. The neural model takes multiple such pairs and predicts which DSL functions are present in the generating program.
Running the Full Neural Pipeline with PCCoder
PCCoder (github.com/amitz25/PCCoder) provides the complete implementation including model training and inference. After cloning and installing requirements:
Train the Neural Predictor
python train.py --data_path data/ --model_path models/Run Program Synthesis
python synthesize.py --examples examples.json --model_path models/trained_modelThe output is a program in the DeepCoder DSL that matches the provided input/output examples.
Performance and Benchmarks
The original 2017 paper reported the following on synthesising programs of up to length 5 (search space ≈ 1010):
| Method | Program Length T=3 (search time) | Program Length T=5 |
|---|---|---|
| Enumerative search (no neural) | Baseline (100%) | Often exceeds timeout |
| DeepCoder (neural-guided) | ~10× speedup vs baseline | Solves within time budget |
| RNN-only approach | Worse than enumerative | Worse than enumerative |
Source: Balog et al. (2017), ICLR. Exact wall-clock numbers depend on hardware; the speedup factor is what the paper benchmarks.
In practice on modern 2026 hardware (an AMD Ryzen 9 7950X or Intel Core i9-14900K), enumerative search for T=3 programs completes in seconds; the neural guide becomes more meaningful at T=4–5 where the search space exceeds 108.
GPU vs CPU for inference: The neural prediction step is a small forward pass over a modest LSTM; it runs adequately on CPU. GPU matters mainly during training of the predictor network.
What Was Removed from Older Guides — and Why
- Python 3.6 / 3.7 / 3.8 / 3.9: No longer supported by TensorFlow 2.21. If you must pin to an old Python, you are limited to TensorFlow ≤ 2.13 — which means missing three years of bug fixes and CUDA support improvements.
pip install tensorflow-gpu: This separate GPU package was merged into the maintensorflowpackage as of TF 2.11. Calling it today installs an alias that just pulls the main package.- Native Windows CUDA path with TF 2.11+: Removed by Google in TF 2.11 (September 2022). Do not attempt to install CUDA on the Windows host and expect TF to use it natively — it will not.
- Mambaforge installer: Deprecated and retired January 2025. All conda-forge documentation now points to Miniforge3.
git clone https://github.com/microsoft/DeepCoder.git: The suggested URL in many older blog posts does not resolve to the canonical repo. The correct URL ishttps://github.com/microsoft/DeepCoder-Utils.git.
Common Pitfalls and Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
No module named tensorflow | Wrong conda environment active | Run conda activate deepcoder and verify with conda env list |
| TF installed but Python 3.9 throws dependency error | TF 2.21 requires Python 3.10+ | Create a new env: conda create -n deepcoder python=3.11 |
| GPU not detected on native Windows with TF 2.12+ | GPU on native Windows dropped in TF 2.11 | Switch to WSL2 + pip install tensorflow[and-cuda] |
z3.exceptions.Z3Exception at import | Mismatched z3-solver version or stale cache | pip install --upgrade z3-solver; restart Python kernel |
C++ compile fails on Windows (make not found) | Make not in PATH | Install via conda install -c conda-forge make m2w64-toolchain |
DLL load failed importing TensorFlow | Missing Visual C++ Redistributable | Install VC++ Redist 2015–2022 x64 from Microsoft |
| Synthesis script runs but produces no output | Examples too ambiguous (too few pairs) | Provide at least 5 input/output pairs; ensure examples are consistent |
| Memory error during PCCoder training | Batch size too large for available RAM | Reduce batch size in training config; use 16 GB+ RAM machine |
How to Choose Your Setup Path
- I just want to explore the DSL utilities (no model needed): Clone
microsoft/DeepCoder-Utils, build the C++ search, rungenerate_io_samples.pyon native Windows. - I want the full neural pipeline without GPU: Use PCCoder on native Windows (CPU), Python 3.11, TF 2.21.
- I want GPU-accelerated training: Use WSL2 + Ubuntu 24.04 +
tensorflow[and-cuda]. - I hit Linux-specific script errors on native Windows: Switch to WSL2 — the codebase was developed on Linux and some shell scripts assume a POSIX environment.
- I want to build on top of this for a real project: Consider whether modern LLM-based code generation tools (GitHub Copilot, Claude Code, Gemini Code Assist) better serve your end goal. The 2017 DeepCoder is a research artefact, not a production coding assistant. If you need vetted developers to integrate AI tooling into a larger system, Codersera's vetted remote developer network can source engineers experienced with ML pipelines and neural program synthesis.
Practical Use Cases (2026 Context)
- Academic research into program synthesis: Reproducing or extending the 2017 benchmark is the primary use case for the official tooling today.
- Teaching neural search techniques: The DeepCoder DSL is small enough to be fully understood in an afternoon, making it ideal for ML courses covering guided search.
- Benchmarking new synthesis methods: Papers in 2024–2025 still use the DeepCoder benchmark format to compare new approaches (e.g., DeepSynth, BUSTLE).
- ETL / data-transformation prototyping: The original paper highlighted automated generation of list-manipulation programs from examples — a valid prototype for small data-wrangling tasks.
FAQ
Is the DeepCoder from this guide the same as DeepCoder-14B on Hugging Face?
No. DeepCoder-14B (from Agentica, 2024) is a large language model fine-tuned for general coding on natural-language prompts. The DeepCoder in this guide is the 2017 Microsoft Research system for synthesising programs in a bespoke 34-function DSL from input/output examples. They share only a name.
Can I run the 2017 DeepCoder without TensorFlow?
Yes, partially. The microsoft/DeepCoder-Utils repository (the C++ enumerative search and the Python DSL sample generator) does not require TensorFlow at all. TensorFlow is only needed if you are training or running the neural prediction model, which requires a community re-implementation such as PCCoder.
Does DeepCoder work with Python 3.12?
TensorFlow 2.21 officially supports Python 3.10–3.13 including 3.12. PCCoder and other community re-implementations may have requirements frozen to older Python versions — check each project's requirements.txt before creating your environment.
Why does TensorFlow not detect my GPU on Windows?
TensorFlow 2.11 (October 2022) was the first release to drop native-Windows GPU support. All subsequent TF versions only support GPU through WSL2. Use pip install tensorflow[and-cuda] inside WSL2 + Ubuntu 24.04 for GPU acceleration.
What is the Z3 solver used for in DeepCoder?
Z3 is an SMT (Satisfiability Modulo Theories) solver from Microsoft Research. In the DeepCoder pipeline it is used as one of the search backends: rather than enumerating programs directly, the SMT formulation encodes constraints from input/output examples and asks Z3 to find a satisfying program. The neural network's function predictions narrow the constraint space fed to Z3.
Is there a Docker image for DeepCoder?
There is no official Docker image. However, running DeepCoder inside WSL2 gives you a fully isolated Linux environment without the overhead of Docker image management. If you need reproducibility for a research paper, containerising the PCCoder environment with a standard Python + TensorFlow base image is straightforward.
How does DeepCoder compare to modern LLM code generation?
They solve fundamentally different problems. DeepCoder synthesises programs in a tiny 34-function DSL from explicit input/output examples — it is interpretable and provably correct with respect to those examples. Modern LLMs (GitHub Copilot, Claude Code, Gemini Code Assist) generate general-purpose code in any language from natural-language prompts but can produce code that is plausible-looking yet incorrect. For research into guaranteed-correct program synthesis, DeepCoder-style approaches remain relevant. For production coding assistance, LLMs are far more practical.
Can DeepCoder run on Windows ARM (Snapdragon X)?
TensorFlow 2.21 does not publish a native Windows ARM wheel. Your options on Windows ARM hardware are: (a) run WSL2 with an x64 Ubuntu image under the compatibility layer, or (b) use PyTorch-based re-implementations of DeepCoder, which are more likely to have ARM-compatible wheels via conda-forge.
References and Further Reading
- Balog et al. (2017) — "DeepCoder: Learning to Write Programs" (arXiv:1611.01989)
- microsoft/DeepCoder-Utils — Official DSL utilities repository (GitHub)
- amitz25/PCCoder — Community full-pipeline implementation (GitHub)
- TensorFlow Installation Guide — tensorflow.org (includes Windows + WSL2 instructions)
- z3-solver on PyPI — current version and release history
- Install WSL — Official Microsoft documentation (learn.microsoft.com)
- Miniforge3 — Lightweight conda distribution (GitHub, conda-forge)
- DeepCoder ICLR 2017 — OpenReview peer review and full paper PDF