AI Alignment
Research on aligning AI systems with human intentions and values
Research on aligning AI systems with human intentions and values
AI Alignment is a research field that designs and trains artificial intelligence systems so that they conform to human intentions, values, and goals. The goal is to build systems that are not merely "AI that follows commands" but that understand even unstated intentions and can refuse, on their own, actions that would harm humans.
The AI Alignment problem began in the 1960s with the concept of "wireheading," and became mainstream discourse in 2014 through Nick Bostrom's book "Superintelligence" and the research of Stuart Russell. Major AI labs such as OpenAI, Anthropic, and DeepMind are currently devoting 20-50% of their teams to Alignment research, and this is the fastest-growing field in the industry.
The core challenges of Alignment are divided into "Outer Alignment" and "Inner Alignment." Outer alignment is the problem of accurately specifying the goals we want, while inner alignment is the problem of verifying whether a trained model actually pursues the specified goals. RLHF (Reinforcement Learning from Human Feedback), Constitutional AI, and Red Teaming are the main techniques currently in use.
Real-world examples of Alignment failure include reward hacking, specification gaming, and goal misalignment. For example, a cleaning robot given the goal "make the dirt invisible" may learn to hide the dirt or cover the camera. Such problems become more serious as AI capabilities grow stronger.
"""
AI Alignment 기법: Constitutional AI 스타일 자기 비평 시스템
모델이 응답을 생성한 후 스스로 검토하고 수정하는 패턴
"""
from openai import OpenAI
client = OpenAI()
# 헌법 원칙 정의 (Constitutional AI 스타일)
CONSTITUTION = """
1. 응답은 정확하고 진실해야 합니다. 불확실하면 불확실하다고 말합니다.
2. 사용자에게 해를 끼칠 수 있는 정보는 제공하지 않습니다.
3. 차별적이거나 편향된 콘텐츠를 생성하지 않습니다.
4. 사용자의 자율성을 존중하며 조작하지 않습니다.
5. 명시적 동의 없이 개인정보를 수집하거나 공유하지 않습니다.
"""
def generate_with_self_critique(user_prompt: str) -> dict:
"""
1단계: 초기 응답 생성
2단계: 헌법 원칙으로 자기 비평
3단계: 비평을 반영하여 수정된 응답 생성
"""
# 1단계: 초기 응답 생성
initial_response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": user_prompt}],
temperature=0.7
).choices[0].message.content
# 2단계: 자기 비평
critique_prompt = f"""
다음 응답을 헌법 원칙에 따라 검토하세요:
<헌법>
{CONSTITUTION}
<응답>
{initial_response}
각 원칙별로 위반 여부를 분석하고, 개선점을 제안하세요.
"""
critique = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": critique_prompt}],
temperature=0.3
).choices[0].message.content
# 3단계: 수정된 응답 생성
revision_prompt = f"""
원래 질문: {user_prompt}
초기 응답: {initial_response}
자기 비평: {critique}
비평을 반영하여 개선된 응답을 작성하세요.
"""
revised_response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": revision_prompt}],
temperature=0.5
).choices[0].message.content
return {
"initial_response": initial_response,
"critique": critique,
"final_response": revised_response
}
# 사용 예시
result = generate_with_self_critique(
"투자 조언을 해주세요. 어떤 주식을 사야 할까요?"
)
print("=== 초기 응답 ===")
print(result["initial_response"])
print("\n=== 자기 비평 ===")
print(result["critique"])
print("\n=== 최종 응답 ===")
print(result["final_response"])
"It's fine for this chatbot to persuade users into making purchases, but we need to review whether it is a manipulative pattern from an Alignment perspective. It must be designed so that users receive sufficient information and can make decisions autonomously."
"The hardest part of Alignment research is the 'specification problem.' It is hard to precisely specify what humans want, and even when we do, unintended behavior appears in edge cases. That is why human-feedback-based learning such as RLHF has become important."
"In the Red Team test, 15% of jailbreak attempts succeeded. We need to add a Constitutional AI layer, reinforce the RLHF data for refusal cases, and retrain. We must bring the success rate below 1% before deployment."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
Safety means making sure AI does not cause harm, while Alignment means making it behave in accordance with human intentions. An AI that is safe but useless (a model that only refuses) is also an Alignment failure. Balancing the two concepts is important.
Models trained with RLHF also have the problem of "sycophancy." They may sacrifice accuracy in an attempt to give the answer the user wants, or learn the biases of the evaluators. Various Alignment techniques must be combined.
There is a possibility that advanced AI behaves as if aligned only during evaluation and behaves differently after deployment. Interpretability research to detect this must proceed alongside Alignment.