Giter Site home page Giter Site logo

growing-tokens's Introduction

growing-tokens

Can you train a tokenizer while training a language model? Kind of! This project shows how you can train a language model starting with a character-level tokenizer and progressively merging tokens with high mutual information over the course of training. We provide a demonstration for how to train on the BabyLM corpus.

Installation Steps on Greene

  1. Clone this repo to /scratch/NETID and cd into it.
  2. Move to an interactive job node:
srun --pty /bin/bash
  1. Copy the following singularity overlay:
cp -rp /scratch/work/public/overlay-fs-ext3/overlay-15GB-500K.ext3.gz .
  1. Extract the gzipped overlay:
gunzip overlay-15GB-500K.ext3.gz
  1. Download the Miniconda Installer
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
  1. Launch the container in read/write mode:
singularity exec --overlay overlay-15GB-500K.ext3:rw /scratch/work/public/singularity/cuda11.6.124-cudnn8.4.0.27-devel-ubuntu20.04.4.sif /bin/bash
  1. Install Miniconda
bash Miniconda3-latest-Linux-x86_64.sh -b -p /ext3/miniconda3 && rm Miniconda3-latest-Linux-x86_64.sh
  1. Create the following script at /ext3/env.sh:
#!/bin/bash

source /ext3/miniconda3/etc/profile.d/conda.sh
export PATH=/ext3/miniconda3/bin:$PATH
export PYTHONPATH=/ext3/miniconda3/bin:$PATH
  1. Activate the conda base environment
source /ext3/env.sh
  1. Install packages we need.
conda env create
  1. Download data
conda activate ccm && python src/data.py

growing-tokens's People

Contributors

jopetty avatar craaaa avatar wtimkey avatar

Watchers

 avatar

growing-tokens's Issues

Cleaning babylm data

  • clean data to remove title lines in wikipedia (they start with '=')
  • consider any other possible things to remove

Training baselines

  • how long does a single epoch take?
  • do multiple epochs (w/ normal tokenizer) help?

Tokenization comparison metrics

Add methods to compare any two tokenizations for:

  • Overlap
  • AoA (if both tokenizations are incremental)
  • Adherence to gold standard morphological segmentation?

retokenize every k steps

  • rn we tokenize once, which works for usual tasks but not for ours since we need to adjust the tokenizer during training
  • should be a training param vocab_update_steps which controls this

Tokenizer baselines

  • End-to-end BPE vocabulary
  • BPE vocabulary with steps
  • Multiple iterations of BPE on subsets of the data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.