Coder Social home page Coder Social logo

lmx's Introduction

LMX

This is the official code repo for the paper "Language Model Crossover: Variation through Few-shot Prompting" (https://arxiv.org/abs/2302.12170).

Language Model Crossover (LMX) is a simple yet effective method of generating solution variations using Large Language Models (LLMs). Parent solutions (represented as text) are concatenated and fed into the LLM, which naturally produces variations, which are parsed as children.

alt text

This repository contains notebooks and scripts for running LMX in the domains from the paper. From these examples we hope you will see how easy it is to apply LMX to new domains :)

Notebooks and Scripts

  • Binary Strings: This notebook applies LMX to the classic evolutionary algorithms domain of evolving strings of 1's and 0's.
  • QD Sentiment: This notebook uses LMX, coupled with MAP-Elites, to generate rephrasings that maintain the original meaning as well as possible, while covering the space of underlying sentiment.
  • Sodaracers: This script uses LMX to generate a diverse array of locomoting virtual creatures represented as python code.
  • Image Generation: This script uses LMX to optimize prompts to image generation models to maxmimize desired image properties.
  • Symbolic Regression: This script uses LMX to discover compact mathematical expressions that model datasets.
  • EDA Comparison: This notebook compares the distribution of offspring produced by LMX to that of a classical Estimation of Distribution Algorithm (EDA).
  • The Effect of Parent Ordering: These scripts and notebook analyze the impact of ordering parents in different ways when feeding them into LMX.

All of these notebooks and scripts use the huggingface transformers API, so the LLM can be easily swapped out for one that's better or more appropriate for your particular domain.

Please let us know if you have any questions. Enjoy!

sample results of QD sentiment optimization

alt text

sample results of symbolic regression

alt text

sample results of prompt optimization for image generation

alt text

alt text

lmx's People

Contributors

ekmeyerson avatar agaier avatar jal278 avatar

Stargazers

Atoosa Parsa avatar Parshin Shojaee avatar

Watchers

 avatar  avatar Mark Nelson avatar

Forkers

atoosaparsa

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.