Utils for SuperAlignment api
Project description
SuperAlignment package
This is the official github repo of pypi package SuperAlignment (https://pypi.org/project/SuperAlignment).
Motivated by OpenAI's alignment paper "WEAK-TO-STRONG GENERALIZATION: ELICITING STRONG CAPABILITIES WITH WEAK SUPERVISION"(https://openai.com/index/weak-to-strong-generalization/), we feel that it's a very interesting direction to define some common interface to train/eval superalignment models in this new area. Right now it has just started from scratch and you are very welcome to contact us if you have any cool ideas that would like to participate and collabratively commit to this repo.
pip install SuperAlignment
import SuperAlignment as sa
input_dict = {"text": "SuperAlignment"}
res = sa.api(input_dict, model=None, api_name="ArxivPaperAPI", start=0, max_results = 3)
paper_list = json.loads(res["text"])
print ("###### Text to Image Recent Paper List:")
for (i, paper_json) in enumerate(paper_list):
print ("### PAPER %d" % (i+1))
print (paper_json)
Common Interface of SuperAlignment Application
class YourSuperAlignmentAPI(BaseAPI):
"""docstring for ClassName"""
def __init__(self, configs):
super(YourSuperAlignmentAPI, self).__init__(configs)
self.name = "xxxxx"
def api(self, input_dict, model, kwargs):
"""
Args:
input_dict: dict, multi-modal input text, image, audio and video
model: huggingface model of tf or pytoch
kwargs: key-value args
Return:
res_dict: dict, multi-modal text text, image, audio and video
"""
res_dict={}
try:
input_text = input_dict["text"] # str
input_image = input_dict["image"] # image path
input_audio = input_dict["audio"] # audio path
input_video = input_dict["video"] # video path
res_dict["text"] = None
res_dict["image"] = None
res_dict["audio"] = None
res_dict["video"] = None
except Exception as e:
print (e)
return res_dict
SuperAlignment Losses
import torch
import torch.nn as nn
import torch.nn.functional as F
def auxConfidentLoss(alpha, t, x_weak, x_strong):
"""
AUXILIARY CONFIDENCE LOSS as in weak to strong generalization paper
"""
ce_loss = nn.CrossEntropyLoss()
x_strong_ind = torch.relu(x_strong - t)
aux_loss = alpha * ce_loss(x_strong, x_weak) + (1-alpha) * ce_loss(x_strong, x_strong_ind)
return aux_loss
Awesome SuperAlignment Papers and Projects
2024 SuperAlignment Paper
PAPER | URL |
---|---|
WEAK-TO-STRONG GENERALIZATION: ELICITING STRONG CAPABILITIES WITH WEAK SUPERVISION | https://cdn.openai.com/papers/weak-to-strong-generalization.pdf |
Strong and weak alignment of large language models with human values | https://arxiv.org/pdf/2408.04655 |
SUPER(FICIAL)-ALIGNMENT: STRONG MODELS MAY DECEIVE WEAK MODELS IN WEAK-TO-STRONG GENERALIZATION | https://arxiv.org/pdf/2406.11431 |
SELF-PLAY WITH EXECUTION FEEDBACK: IMPROVING INSTRUCTION-FOLLOWING CAPABILITIES OF LARGE LANGUAGE MODELS | https://arxiv.org/pdf/2406.13542 |
Quantifying the Gain in Weak-to-Strong Generalization | https://arxiv.org/abs/2405.15116 |
A Superalignment Framework in Autonomous Driving with Large Language Models | https://arxiv.org/abs/2406.05651 |
A Moral Imperative: The Need for Continual Superalignment of Large Language Models | https://arxiv.org/abs/2403.14683 |
Vision Superalignment: Weak-to-Strong Generalization for Vision Foundation Models | https://arxiv.org/abs/2402.03749 |
Improving Weak-to-Strong Generalization with Scalable Oversight and Ensemble Learning | https://arxiv.org/abs/2402.00667 |
AI Services Reviews and Ratings
Chatbot
OpenAI o1 Reviews
ChatGPT User Reviews
Gemini User Reviews
Perplexity User Reviews
Claude User Reviews
Qwen AI Reviews
Doubao Reviews
ChatGPT Strawberry
Zhipu AI Reviews
AI Image Generation
Midjourney User Reviews
Stable Diffusion User Reviews
Runway User Reviews
GPT-5 Forecast
Flux AI Reviews
Canva User Reviews
AI Video Generation
Luma AI
Pika AI Reviews
Runway AI Reviews
Kling AI Reviews
Dreamina AI Reviews
AI Education
Coursera Reviews
Udacity Reviews
Grammarly Reviews
Robotics
Tesla Cybercab Robotaxi
Tesla Optimus
Figure AI
Unitree Robotics Reviews
Waymo User Reviews
ANYbotics Reviews
Boston Dynamics
AI Tools
AI Widgets
Apple Glasses
Meta Glasses
Apple AR VR Headset
Google Glass
Meta VR Headset
Google AR VR Headsets
Social
Self-Driving
BYD Seal
Tesla Model 3
BMW i4
Baidu Apollo Reviews
Hyundai IONIQ 6
Related Blogs
Open AI Weak to Strong Generalization
Introduction to multimodal generative models
Generative AI Search Engine Optimization
AI Image Generator User Reviews
AI Video Generator User Reviews
AI Chatbot & Assistant Reviews
Best AI Tools User Reviews
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file SuperAlignment-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: SuperAlignment-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 883652064c29451cbd91c6ba01e8fdd45da38fba3ac9dca489d45d58fe17736d |
|
MD5 | 18c0df405fa16912917a9637c94c2815 |
|
BLAKE2b-256 | c5bea2b71d6dd3723f957e7373dd3054943ffb9f4cc344bf05f4561c21244cee |